Skip to main content

isSampleOrganization

talawa-api


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:

  1. Retrieves the organization from the database using the provided organization ID.
  2. If the organization is not found, throws an unauthorized error.
  3. Searches for a sample document associated with the organization ID in the SampleData collection.
  4. Returns true if the sample document is found, indicating the organization is a sample organization; otherwise, returns false.

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.

Defined in

src/resolvers/Query/organizationIsSample.ts:21