Giter Club home page Giter Club logo

Comments (9)

NeedleInAJayStack avatar NeedleInAJayStack commented on June 14, 2024 2

@d-exclaimation Haha, that's exactly what I did! Great minds think alike!

@cshadek Could you try this #97 and validate that it fixes your Connection issue as well?

from graphiti.

cshadek avatar cshadek commented on June 14, 2024 2

@NeedleInAJayStack I just tried a bunch of orders for Connections, Unions, Types, and Interfaces and they all worked. Nice work!

from graphiti.

d-exclaimation avatar d-exclaimation commented on June 14, 2024 1

I'll take a look at this. I am assuming the problem is about using those types in a query, mutation, or subscription field(s) require them to be declared in a PartialSchema that's ordered before where the fields are

from graphiti.

d-exclaimation avatar d-exclaimation commented on June 14, 2024 1

@d-exclaimation Interesting. It also is an issue if an interface is after a type that implements it.

Got it. I was able to reproduce the issue. I noticed this is also might be a problem with just regular Schema, where intefaces need be declared before any types that uses it.

@NeedleInAJayStack can you verify this? does an interface need to be declared before being used?

from graphiti.

NeedleInAJayStack avatar NeedleInAJayStack commented on June 14, 2024 1

Yeah, I am able to recreate too. Ideally no ordering should be required - I'll look at fixing this tonight. Thanks for reporting @cshadek

from graphiti.

cshadek avatar cshadek commented on June 14, 2024

As a side note, I'm really excited to refactor my existing 1500+ line schema and start using PartialSchemas! I've already noticed a lot of improvement with the code completion in the smaller schemas while trying them out.

from graphiti.

cshadek avatar cshadek commented on June 14, 2024

After further analysis, it seems to be an issue exclusive to Interfaces, Unions, and ConnectionTypes. These all need to be declared before they are used in a type or query. While not ideal, this is not the end of the world.

from graphiti.

cshadek avatar cshadek commented on June 14, 2024

@d-exclaimation Interesting. It also is an issue if an interface is after a type that implements it.

from graphiti.

d-exclaimation avatar d-exclaimation commented on June 14, 2024

Yeah, I am able to recreate too. Ideally no ordering should be required - I'll look at fixing this tonight. Thanks for reporting @cshadek

Not sure exactly how to properly fix this, but one idea I had is to sort the component declared by like a priority, for example:

Scalars > Enums > Inputs > Interface > Type (Object) > Union > Query > Mutation > Subscription

I guess this would have not immediately solve the case where something like a Union is referenced by a Type (Object), Interfaces, or other Unions. However, so far this method seems to work

from graphiti.

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.