Issue parsing printed GraphQL schema (documentation that ends in `"`)
See original GitHub issueIf a description in a GraphQL schema ends with a quotation mark " then you can no longer parse(printSchema(schema)) - i.e. the printed schema cannot be parsed.
Here’s a small script that reproduces the issue:
const {
GraphQLObjectType,
GraphQLSchema,
GraphQLInt,
printSchema,
parse,
} = require("graphql");
const makeSchema = withBadComment =>
new GraphQLSchema({
query: new GraphQLObjectType({
name: "Query",
fields: {
hello: {
type: GraphQLInt,
},
},
description: withBadComment
? `Something ending with a "quote"`
: `Something with "quote" inside.`,
}),
});
function test(schema) {
const schemaString = printSchema(schema);
console.log(schemaString);
const parsed = parse(schemaString);
console.dir(parsed);
}
console.log("Testing good schema");
test(makeSchema(false));
console.log();
console.log();
console.log(
"********************************************************************************"
);
console.log();
console.log();
console.log("Testing bad schema");
test(makeSchema(true));
GraphQL version: 0.12.3
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Full Stack Error Handling with GraphQL and Apollo
As a front-end developer, I would like to display rich error feedback in the UI to empower my users to fix their own...
Read more >Five Common Problems in GraphQL Apps (And How to Fix ...
Problem : Schema Duplication. One of the first things you realize when coding a GraphQL back-end from scratch is that it involves a...
Read more >GraphQL specification
When using the type system definition language, a document must include at most one schema definition. In this example, a GraphQL schema is...
Read more >The complete GraphQL Security Guide: Fixing the 13 most ...
The grammar for parsing a GraphQL document is 325 lines. ... it's a repetitive schema but we're also going to address this issue...
Read more >Custom schema as workaround to plurals issue - GraphQL API
Let's say I have a Parse class called “Media”. ... In the GraphQL guide under Adding Custom Schema there is some documentation, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@benjie Sorry, I completely missed that comment. Just trying to push
14.0.0forward by cleaning up issues/PRs.Codemirror depends on graphql-language-service so it should be updated first and I don’t have commit rights to this repo. I will try to make PR this week and ping someone who has commit rights. Feel free to ping me in this issue.
Is it possible to either get a fix for this backported to 0.12.x, or have codemirror-graphql support 0.13.2+?