Skip to content

bugfix: fix introspection and re-declaration of config #1858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

Simperfit
Copy link
Contributor

@Simperfit Simperfit commented Apr 12, 2018

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets none
License MIT
Doc PR maybe not needed

So, I was trying GraphiQL, and wanted to develop an little test app with it see Simperfit/graphql-api@b521052 but I got into a little bug on the re-declaration of config, that fixed, i've seen another error with the declared type in the SchemaBuilder.

As I don't really followed the GraphQL development, I'm trying to figure out how to fix this.

"""
{"query":"\n query IntrospectionQuery {\n __schema {\n queryType { name }\n mutationType { name }\n subscriptionType { name }\n types {\n ...FullType\n }\n directives {\n name\n description\n locations\n args {\n ...InputValue\n }\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n description\n fields(includeDeprecated: true) {\n name\n description\n args {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n description\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n\n fragment InputValue on __InputValue {\n name\n description\n type { ...TypeRef }\n defaultValue\n }\n\n fragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n }\n"}
"""
And print last JSON response
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is failing with:

│ {
      │     "errors": [
      │         {
      │             "debugMessage": "Unknown kind of type: StringIterableUnionInput",
      │             "message": "Internal server error",
      │             "category": "internal",
      │             "locations": [
      │                 {
      │                     "line": 62,
      │                     "column": 5
      │                 }
      │             ],
      │             "path": [
      │                 "__schema",
      │                 "types",
      │                 258,
      │                 "inputFields",
      │                 2,
      │                 "type",
      │                 "kind"
      │             ]
      │         },
      │         {
      │             "debugMessage": "Unknown kind of type: StringIterableUnionInput",
      │             "message": "Internal server error",
      │             "category": "internal",
      │             "locations": [
      │                 {
      │                     "line": 22,
      │                     "column": 5
      │                 }
      │             ],
      │             "path": [
      │                 "__schema",
      │                 "types",
      │                 259,
      │                 "kind"
      │             ]
      │         }
      │     ],
      │     "data": []
      │ }

In 2.2.5 this is not failing.

@Simperfit Simperfit force-pushed the bugfix/graphiql-schema-documentor-not-working-anymore branch from fe5acf3 to f093e07 Compare April 13, 2018 08:57
@Simperfit Simperfit changed the title [WIP] bugfix: fix introspection and re-declaration of config bugfix: fix introspection and re-declaration of config Apr 13, 2018
@Simperfit Simperfit requested a review from dunglas April 13, 2018 08:58
@Simperfit
Copy link
Contributor Author

ping @alanpoulain for a review when you have time please.

@Simperfit Simperfit self-assigned this Apr 13, 2018
@Simperfit Simperfit force-pushed the bugfix/graphiql-schema-documentor-not-working-anymore branch 6 times, most recently from 73ff5dc to 92ac4c9 Compare April 13, 2018 11:41
Amrouche Hamza added 2 commits April 13, 2018 14:07
* update webonyx/graphql to last version where it introduce a $config and remove it
* fix the SchemaBuilder to be able to generate the documentation
@Simperfit Simperfit force-pushed the bugfix/graphiql-schema-documentor-not-working-anymore branch from 92ac4c9 to d520833 Compare April 13, 2018 12:07
@Simperfit
Copy link
Contributor Author

Simperfit commented Apr 13, 2018

Okay so this fixes the generation of the schema, but it does not fix how GraphiQL expects the schema to be.
I'm getting lots of errors:
Error: "updateGerardInput.hellos field type must be Input Type but got: [StringIterableUnionInput]."
Error: "Introspection must provide object type for possibleTypes."

Here is a valid reproducer : Simperfit/graphql-api@bb1e22d (this patch needs to be applied on the vendor directory)

@alanpoulain
Copy link
Member

alanpoulain commented Apr 15, 2018

I'm working on it. I've identified the issue and opened an issue in graphql-php. See webonyx/graphql-php#272.
The branch: https://github.com/alanpoulain/core/commits/fix/introspection-custom-types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants