Skip to main content

default

talawa-apiDocs


talawa-api / directives/directiveTransformer/authDirectiveTransformer / default

Function: default()

> default(schema, directiveName): GraphQLSchema

A function to transform a GraphQL schema by adding authentication logic to the fields with the specified directive.

Parameters

schema: GraphQLSchema

The original GraphQL schema to be transformed.

directiveName: string

The name of the directive that will trigger the transformation.

Returns

GraphQLSchema

A new GraphQL schema with the authentication logic applied.

See

Parent File:

  • src/index.ts

Example

`const transformedSchema = authDirectiveTransformer(originalSchema, 'auth');`

Defined in

src/directives/directiveTransformer/authDirectiveTransformer.ts:22