Git Product home page Git Product logo

Comments (9)

pgutkowski avatar pgutkowski commented on July 19, 2024

There is an issue with nested fragments : right now fragments are resolved sequentially, so if query would define InputValue fragment and then FullType, it would work, but not other way around. I was aware of it but I didn't have time to do it yet. It will get on top of my priorities. Thank you very much for your report.

BTW First query is weird, it has selection set

        directives {
            name
            description
            args {
                ...InputValue
            }
            onOperation
            onFragment
            onField
        }

GraphQL spec does not define onOperation, onFragment or onField for __Directive type, see http://facebook.github.io/graphql/#sec-The-__Directive-Type. Second query seems to be perfectly valid.

from kgraphql.

Paradoxia avatar Paradoxia commented on July 19, 2024

Maybe onOperation, onFragment and onField belongs to an upcoming specification or a draft? Noticed some frameworks implementing them.

graphql-java
graphql.v0

But I think it's good that you follow the official specification.

from kgraphql.

pgutkowski avatar pgutkowski commented on July 19, 2024

Hm, maybe. Or it was part of previous versions of spec. Anyway, I have fixed nested fragments issue and released 0.2.1 version. It contains fix for #1 too. Please try it and close this issue if effects will be satisfying.

Thank you for your input and issue reports, it is really valuable for development of this library!

from kgraphql.

Paradoxia avatar Paradoxia commented on July 19, 2024

Okay so graphdoc can now execute the introspection query and create documentation. But there is something strange going on. I noticed that my query doesn't show up in the documentation. This is how it looks in my code.

  query("productions") {
            description = "Get list of productions"
            resolver { page: Int -> streamlyResolver.listProductions(page) }
                    .withArgs {
                        arg<Int> {
                            name = "page"
                            defaultValue = 0
                            description = "Page number (starting from 0)"
                        }
                    }
        }

If i do my own introspection query like this

{
  __schema {
    queryType {
      name
      fields {
        name
        description
        args {
          name
          description
          type { name description }
        }
      }
    }
  }
}

----> result --->

{
  "data": {
    "__schema": {
      "queryType": {
        "name": "Query",
        "fields": [
          {
            "name": "productions",
            "description": "Get list of productions",
            "args": [
              {
                "name": "page",
                "description": "Page number (starting from 0)",
                "type": {
                  "name": null,
                  "description": "NonNull wrapper type"
                }
              }
            ]
          } ...

then i can see my query. BUT neither graphdoc or graphql-docs use that kind of query to extract available queries from the schema. Instead I think they expect queries to show up in this.

                    types {
                        name
                        kind
                        description
                        ...FullType
                    }

from kgraphql.

Paradoxia avatar Paradoxia commented on July 19, 2024

Someone created this mega introspection query that you could try out (- onOperation,onFragment and onField). Looks like it also expect queries to show up under "types".

from kgraphql.

pgutkowski avatar pgutkowski commented on July 19, 2024

Okay, I will take a look on that. I'm starting to think that adding onOperation, onFragment and onField fields to __Directive for compatibility purposes would be good idea too.

from kgraphql.

Paradoxia avatar Paradoxia commented on July 19, 2024

Good idea. I suggest you add onOperation, onFragment, onField but as deprecated fields. If I understand it right they have been replaced by locations (under directives)

Never mind .. I think location(s) where only a draft

from kgraphql.

pgutkowski avatar pgutkowski commented on July 19, 2024

0.2.3 version has been released, it was tested with graphql-docs and graph-doc and now it works just fine with creation of static documentation. onOperation, onFragment, onField fields has been added to __Directive.

Please check if it works for you. Have in mind that graphql-docs seems to not support union types: https://github.com/mhallin/graphql-docs/blob/master/src/model.js#L3

from kgraphql.

Paradoxia avatar Paradoxia commented on July 19, 2024

I'm getting expected result. Good job.

from kgraphql.

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.