Git Product home page Git Product logo

Comments (15)

comigor avatar comigor commented on July 18, 2024

And another problem when parsing the GitHub schema:

Bad state: No element
dart:isolate  _RawReceivePortImpl._handleMessage

Not a significant stacktrace, though :(

from gql.

klavs avatar klavs commented on July 18, 2024

@comigor, it should be type Area implements Node & Entity

https://spec.graphql.org/June2018/#sec-Objects

from gql.

klavs avatar klavs commented on July 18, 2024

@comigor, I was able to parse the official github schema just fine. Would you be able to narrow your SDL to the part which actually fails?

from gql.

klavs avatar klavs commented on July 18, 2024

It's line 813.
https://gist.github.com/comigor/5be2f6172e70aa118d99f86f272022a8#file-github-schema-graphql-L810-L814

from gql.

comigor avatar comigor commented on July 18, 2024

Oh, you're absolutely right about the spec, though some tools that convert Introspection queries to SDL seem to generate the SDL with commas.

Do you know if the spec was different before 2018? If it used a comma before, shouldn't we be retro-compatible and parse it as well?

Reference of code used in the conversion: https://gist.github.com/stubailo/041999ba5b8b15cede60b93ff9a38f53#file-introspection-result-to-sdl-js

from gql.

comigor avatar comigor commented on July 18, 2024

The GitHub SDL I'm using was also converted from Introspection query, so I think it may be the same (or a similar) problem.

from gql.

klavs avatar klavs commented on July 18, 2024

A quick search over older versions of the spec (https://spec.graphql.org/) does not reveal any useful info about commas as separators for interfaces.

Comma is actually an ignored token in GraphQL. https://spec.graphql.org/June2018/#sec-Appendix-Grammar-Summary.Ignored-Tokens

It's weird because the snippet you gave uses the reference implementation which uses & as a separator. https://github.com/graphql/graphql-js/blob/af480089b5fcaa961adb356ef1dca13cf475e75f/src/utilities/printSchema.js#L192

from gql.

comigor avatar comigor commented on July 18, 2024

Wow that's weird! Apparently I've used a legacy version of this library (of 2 years ago): https://github.com/graphql/graphql-js/blame/652c0323ea2265fd1d001a9ee36fe9232369b75f/src/utilities/schemaPrinter.js#L179

from gql.

comigor avatar comigor commented on July 18, 2024

So probably GitHub wasn't working due to another spec difference.

from gql.

klavs avatar klavs commented on July 18, 2024

Yes, the GitHub example had a multi-line comment badly printed, probably.

from gql.

comigor avatar comigor commented on July 18, 2024

Actually, I'm still not able to parse the GitHub schema from the official source: https://github.com/octokit/graphql-schema

from gql.

klavs avatar klavs commented on July 18, 2024

That's interesting. You may notice I added a github example borrowed from package:graphql to this repo. It uses the same schema file you are pointing to (the*.graphql one; not *.json transformed).

I had some issues at the build layer, but the parser itself worked just fine without adjustment.

from gql.

comigor avatar comigor commented on July 18, 2024

I'm now trying to parse the official SDL schema (without conversion) from octokit repos without success.

from gql.

klavs avatar klavs commented on July 18, 2024

What version of package:gql are you using?
What's the error message and/or stacktrace you get?

from gql.

comigor avatar comigor commented on July 18, 2024

Artemis is now parsing AST schemas directly (and the examples have proper conversions)

from gql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.