Custom types starting with underscore are missing from graphql explorer and introspection

If I create a custom type that begins with an underscore, for example, "_test_type", this type does not show up in graphql explorer or introspection.

This is related to CamelCase named fields are missing in GraphQL explorer and introspection - #9 by Fares

This is easily reproducible on any repo.

  1. Create a custom type called "_test_type"
  2. Add a document of that type
  3. Go to graphiql and try to query for that document type

Result: "_test_type" and "all_Test_types" are not there in graphql explorer

If I create a type called "test_type" and add a new document, as you'd expect, I can query "test_type" and "allTest_types". However, if you put an underscore at the beginning of the type name, nothing shows for that type in graphql explorer.

Hello @web2, thanks for pointing this out. I'm not sure if this behavior is intended to work with the GraphQL schema. I'll share this with the team and let you know what we conclude.

Sounds good, thanks.

We confirm that any Custom Type that starts with an underscore doesn’t appear in the GraphQL API. There’s currently a server error that happens, likely because it can’t or doesn’t convert the _test_type ID to something like TestType .If you query a document with a type ID like _test_type , you’ll get an error from the API.

I've opened an issue on the tracker.
In the meantime, please avoid prefixing IDs with this character to avoid future errors.

1 Like