Skip to content

Custom directives are stripped during schema printting? #1072

Closed
@dotansimha

Description

@dotansimha

Trying to understand why my custom GraphQL directives are stripped when printSchema is executed (also using ``).

Found this line of code (isSpecDirective):

export function printIntrospectionSchema(schema: GraphQLSchema): string {
return printFilteredSchema(schema, isSpecDirective, isIntrospectionType);
}
function isSpecDirective(directiveName: string): boolean {
return (
directiveName === 'skip' ||
directiveName === 'include' ||
directiveName === 'deprecated'
);
}

Is there a reason for removing custom directives? I understand the @deprecated is a special directive and it effects more than just the docs, but I want to implement a custom directive such as skip or include - but the printer/introspection removes them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions