Git Product home page Git Product logo

Comments (5)

jaredh159 avatar jaredh159 commented on August 28, 2024

I accidentally created the issue before I described the problem, fixed now. Sorry about that.

from graphql-kit.

alexsteinerde avatar alexsteinerde commented on August 28, 2024

I haven't had this issue before. Bug I could reproduce it (The example repo was very handy!) and I fixed it.
This GraphQL Swift api is a bit confusing.
By using the Order type in the query this type is registered automatically (implicitly).
The type OrderItem is not implicitly registered.
You can explicitly register the type OrderItem by adding this line to the bottom of your schema: Types(OrderItem.self) (Example: https://github.com/GraphQLSwift/Graphiti/blob/af903a243862c6427935677b91f67df0c21f2a71/Tests/GraphitiTests/StarWarsAPI/StarWarsAPI.swift#L101).
I hope this can help you.

from graphql-kit.

jaredh159 avatar jaredh159 commented on August 28, 2024

from graphql-kit.

jaredh159 avatar jaredh159 commented on August 28, 2024

Sure enough, that completely fixes it. Although I can't say that I understand fully why. It seems like there's a very explicit registration of the OrderItem type in the schema, when I define it as a GraphQL type using Type(OrderItem.self) { ... on this line. But I'm probably still missing a something.

Really appreciate the help, as always.

from graphql-kit.

alexsteinerde avatar alexsteinerde commented on August 28, 2024

I agree, this doesn't seem perfect from an API perspective. But I also don't know enough about the Graphiti implementation so I can't explain the reason for this.
Maybe there will be a better way in the future.

from graphql-kit.

Related Issues (17)

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.