Skip to content
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

Enable schemaDescription & inputTypeDeprecation #2077

Merged
merged 2 commits into from
Dec 4, 2021

Conversation

acao
Copy link
Member

@acao acao commented Dec 4, 2021

Not sure why schemaDescription wasn't already enabled for GraphiQL introspection queries?

Either way, this fixes the DocExplorer schema.description issue in #2027 when fetcher is provided instead of schema prop.

Also added support for input type deprecationReason

@changeset-bot
Copy link

changeset-bot bot commented Dec 4, 2021

🦋 Changeset detected

Latest commit: cb9a6aa

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
graphiql Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2021

The latest changes of this PR are available as canary in npm (based on the declared changesets):

graphiql@1.5.9-canary-a4943cd7.0

@acao acao force-pushed the fix/graphiql-schema-description branch from a478e6d to f82f590 Compare December 4, 2021 09:11
@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2021

@codecov
Copy link

codecov bot commented Dec 4, 2021

Codecov Report

Merging #2077 (cb9a6aa) into main (2d91916) will decrease coverage by 2.07%.
The diff coverage is 69.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2077      +/-   ##
==========================================
- Coverage   65.70%   63.62%   -2.08%     
==========================================
  Files          85       94       +9     
  Lines        5106     5499     +393     
  Branches     1631     1698      +67     
==========================================
+ Hits         3355     3499     +144     
- Misses       1747     1995     +248     
- Partials        4        5       +1     
Impacted Files Coverage Δ
packages/codemirror-graphql/src/hint.ts 94.73% <ø> (ø)
packages/codemirror-graphql/src/lint.ts 100.00% <ø> (ø)
packages/codemirror-graphql/src/results/mode.ts 47.05% <ø> (ø)
...kages/codemirror-graphql/src/utils/forEachState.ts 100.00% <ø> (ø)
...ckages/codemirror-graphql/src/utils/mode-indent.ts 0.00% <0.00%> (ø)
packages/codemirror-graphql/src/variables/hint.ts 89.70% <ø> (ø)
packages/codemirror-graphql/src/variables/mode.ts 79.48% <ø> (ø)
packages/graphiql/src/components/QueryEditor.tsx 63.96% <ø> (ø)
...graphiql/src/components/__tests__/ExampleSchema.ts 100.00% <ø> (ø)
packages/graphiql/src/utility/fillLeafs.ts 5.33% <ø> (ø)
... and 47 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fe5bb0d...cb9a6aa. Read the comment docs.

@acao acao force-pushed the fix/graphiql-schema-description branch from f82f590 to 1cc793a Compare December 4, 2021 09:12
@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2021

@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2021

@github-actions github-actions bot temporarily deployed to graphiql-cdn-preview December 4, 2021 09:15 Inactive
@github-actions github-actions bot temporarily deployed to graphiql-webpack-preview December 4, 2021 09:15 Inactive
@github-actions github-actions bot temporarily deployed to monaco-graphql-webpack-preview December 4, 2021 09:16 Inactive
@github-actions github-actions bot temporarily deployed to graphiql-cdn-preview December 4, 2021 13:55 Inactive
@github-actions github-actions bot temporarily deployed to monaco-graphql-webpack-preview December 4, 2021 13:55 Inactive
@github-actions github-actions bot temporarily deployed to graphiql-webpack-preview December 4, 2021 13:55 Inactive
@acao acao force-pushed the fix/graphiql-schema-description branch from 523c856 to cb9a6aa Compare December 4, 2021 14:40
@github-actions github-actions bot temporarily deployed to graphiql-webpack-preview December 4, 2021 14:43 Inactive
@github-actions github-actions bot temporarily deployed to graphiql-cdn-preview December 4, 2021 14:43 Inactive
@github-actions github-actions bot temporarily deployed to monaco-graphql-webpack-preview December 4, 2021 14:44 Inactive
@acao acao changed the title Enable schemaDescription for getIntrospectionQuery Enable schemaDescription & inputTypeDeprecation Dec 4, 2021
@acao acao merged commit 701ca13 into main Dec 4, 2021
@acao acao deleted the fix/graphiql-schema-description branch December 4, 2021 14:46
This was referenced Dec 4, 2021
@sebastienbarre
Copy link

sebastienbarre commented Dec 7, 2021

Took me a few minutes, but this is where the problem started.
Starting 1.5.9, including https://unpkg.com/graphiql/graphiql.min.js is very broken, resulting in a non-functioning UI.
I replaced that include with explicit versions, until I found that only 1.5.8 was still working.
The errors showing up in 1.5.9 when using src="https://unpkg.com/graphiql@1.5.9/graphiql.min.js"

{
  "errors": [
    "{\n  \"errors\": [\n    {\n      \"message\": \"Cannot query field \\\"description\\\" on type \\\"__Schema\\\".\",\n      \"extensions\": {\n        \"category\": \"graphql\"\n      },\n      \"locations\": [\n        {\n          \"line\": 4,\n          \"column\": 9\n        }\n      ]\n    },\n    {\n      \"message\": \"Unknown argument \\\"includeDeprecated\\\" on field \\\"args\\\" of type \\\"__Directive\\\".\",\n      \"extensions\": {\n        \"category\": \"graphql\"\n      },\n      \"locations\": [\n        {\n          \"line\": 16,\n          \"column\": 16\n        }\n      ]\n    },\n    {\n      \"message\": \"Cannot query field \\\"specifiedByURL\\\" on type \\\"__Type\\\".\",\n      \"extensions\": {\n        \"category\": \"graphql\"\n      },\n      \"locations\": [\n        {\n          \"line\": 27,\n          \"column\": 7\n        }\n      ]\n    },\n    {\n      \"message\": \"Unknown argument \\\"includeDeprecated\\\" on field \\\"args\\\" of type \\\"__Field\\\".\",\n      \"extensions\": {\n        \"category\": \"graphql\"\n      },\n      \"locations\": [\n        {\n          \"line\": 31,\n          \"column\": 14\n        }\n      ]\n    },\n    {\n      \"message\": \"Unknown argument \\\"includeDeprecated\\\" on field \\\"inputFields\\\" of type \\\"__Type\\\".\",\n      \"extensions\": {\n        \"category\": \"graphql\"\n      },\n      \"locations\": [\n        {\n          \"line\": 40,\n          \"column\": 19\n        }\n      ]\n    },\n    {\n      \"message\": \"Cannot query field \\\"isDeprecated\\\" on type \\\"__InputValue\\\".\",\n      \"extensions\": {\n        \"category\": \"graphql\"\n      },\n      \"locations\": [\n        {\n          \"line\": 62,\n          \"column\": 7\n        }\n      ]\n    },\n    {\n      \"message\": \"Cannot query field \\\"deprecationReason\\\" on type \\\"__InputValue\\\".\",\n      \"extensions\": {\n        \"category\": \"graphql\"\n      },\n      \"locations\": [\n        {\n          \"line\": 63,\n          \"column\": 7\n        }\n      ]\n    }\n  ]\n}"
  ]
}

@sebastienbarre
Copy link

sebastienbarre commented Dec 7, 2021

1.5.10 does not seem to exist, and the errors for 1.5.11 and 1.5.12 (which is the last one at the time of writing this):

{
  "errors": [
    "{\n  \"errors\": [\n    {\n      \"message\": \"Cannot query field \\\"description\\\" on type \\\"__Schema\\\".\",\n      \"extensions\": {\n        \"category\": \"graphql\"\n      },\n      \"locations\": [\n        {\n          \"line\": 4,\n          \"column\": 9\n        }\n      ]\n    }\n  ]\n}"
  ]
}

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

Successfully merging this pull request may close these issues.

2 participants