isSampleOrganization
talawa-api • Docs
talawa-api / resolvers/Query/organizationIsSample / isSampleOrganization
Variable: isSampleOrganization
> const
isSampleOrganization: QueryResolvers
["isSampleOrganization"
]
Checks whether the specified organization is a sample organization.
This function performs the following steps:
- Retrieves the organization from the database using the provided organization ID.
- If the organization is not found, throws an unauthorized error.
- Searches for a sample document associated with the organization ID in the
SampleData
collection. - Returns
true
if the sample document is found, indicating the organization is a sample organization; otherwise, returnsfalse
.
Param
This parameter is not used in this resolver function but is included for compatibility with GraphQL resolver signatures.
Param
The arguments provided by the GraphQL query, including:
id
: The ID of the organization to check.
Returns
A promise that resolves to true
if the organization is a sample organization, otherwise false
.