graphql-transform-schema icon indicating copy to clipboard operation
graphql-transform-schema copied to clipboard

transformSchema removes directives

Open kbrandwijk opened this issue 7 years ago • 3 comments

See https://github.com/apollographql/apollo-server/issues/643 for more details.

kbrandwijk avatar Oct 26 '17 14:10 kbrandwijk

I think this might be caused by the fact that a new schema is created, instead of manipulating the schema that is passed in. https://github.com/graphcool/graphql-transform-schema/blob/master/src/index.ts#L18

kbrandwijk avatar Oct 26 '17 17:10 kbrandwijk

Good catch @kbrandwijk. Would you mind creating a PR that additionally copies the directives as well?

schickling avatar Oct 27 '17 14:10 schickling

@schickling I think it's a bit more than that, because if you specify any custom directive in your schema, it doesn't automatically show up in the schema.getDirectives() result.

I think the necessary refactoring is to not create a new schema, but I'm not 100% sure how.

kbrandwijk avatar Oct 27 '17 14:10 kbrandwijk