graphql-playground icon indicating copy to clipboard operation
graphql-playground copied to clipboard

Not showing custom directives

Open tomasAlabes opened this issue 4 years ago • 2 comments

This issue pertains to the following package(s):

  • [X] GraphQL Playground - Electron App
  • [ ] GraphQL Playground HTML
  • [ ] GraphQL Playground
  • [ ] GraphQL Playground Express Middleware
  • [ ] GraphQL Playground Hapi Middleware
  • [ ] GraphQL Playground Koa Middleware
  • [ ] GraphQL Playground Lambda Middleware

What OS and OS version are you experiencing the issue(s) on?

Mac OS, Catalina

What version of graphql-playground(-electron/-middleware) are you experiencing the issue(s) on?

1.8.10

What is the expected behavior?

To see my custom directives in the schema tab. Mentioned in #803.

What is the actual behavior?

It shows the definition but not on the schema elements.

What steps may we take to reproduce the behavior?

Add your custom directive and try to see it used in the schema. Example, I added @upper on the cat's name in this example.

Screen Shot 2020-04-22 at 11 05 44

tomasAlabes avatar Apr 22 '20 18:04 tomasAlabes

Can confirm this bug on GraphQL Playground HTML. My directive doesn't even show up like above though, but I can confirm from the functionality that it is there. Tried downloading the schema file and it is not present either.

mgwidmann avatar Nov 17 '20 22:11 mgwidmann

Any updates on this?

I can confirm this issue is still present.

"apollo-server-express": "^3.6.1",
"@graphql-tools/utils": "^8.6.1",

This is using the schema directive approach documented here; https://www.graphql-tools.com/docs/schema-directives#uppercasing-strings

It does appear some SDL definition is printed for this example; https://www.graphql-tools.com/docs/schema-directives#enforcing-value-restrictions But the directive printed to the SDL is the Scalar name rather than the directive.

name: StringWithLengthAtMost10

The type should be printed to the SDL as;

name: String @length(max: 10)

PaulSavignano avatar Jan 14 '22 19:01 PaulSavignano