I was wondering if there is anyway to configure a directive. I have some options I load during the startup I would like to pass to the directive.
Edit: I known that I can pass options from the schema, but that's not what I'm looking for.
new ApolloServer({
typeDefs: [schema, constraintDirectiveTypeDefs],
schemaDirectives: { myDirect: Mydirective}
});
or
SchemaDirectiveVisitor.visitSchemaDirectives(schema, {
constraint: Mydirective
});
Something like :
export class ConstraintDirective extends SchemaDirectiveVisitor {
constuctor(options) {
}
visitInputFieldDefinition(field: GraphQLInputField): void {
}
Regards