Giter VIP home page Giter VIP logo

Comments (8)

josephsavona avatar josephsavona commented on May 20, 2024

This is intended, as Relay needs to understand how the argument values of the root field correspond to the response values. We've solved this by limiting the flexibility of the root field, but it is possible that we could remove this limitation.

Can you describe an example use-case where multiple arguments would be valuable?

from relay.

devknoll avatar devknoll commented on May 20, 2024

In my situation, I have a route with two variables (/:moduleSlug/:tutorialSlug), both required to resolve the query. I was trying to pass them to a tutorial(module: $module, tutorial: $tutorial) root query.

The INPUT_TYPE seems like it will work for now, but not ideal. Let me know if you have another idea for how this could be solved.

from relay.

jardakotesovec avatar jardakotesovec commented on May 20, 2024

How about lists and connections as root fields? That is also limited, right?

from relay.

devknoll avatar devknoll commented on May 20, 2024

Never mind, input objects don't work here either (Unexpected arg kind: ObjectValue)...

from relay.

yuzhi avatar yuzhi commented on May 20, 2024

@devknoll this might be a bit hacky, but have you tried getting that root query to take in a string and JSON.stringify the two variables?

@jardakotesovec Correct, connections can not be root fields at the moment. As @josephsavona mentioned, we might be able to remove these limitations

from relay.

devknoll avatar devknoll commented on May 20, 2024

@yuzhi So, I think in my own case, I might just change my urls to be less hierarchical (they are getting ridiculous as is...).

But lots of folks do use hierarchical urls, so it seems like a restriction worth removing, if possible.

from relay.

yuzhi avatar yuzhi commented on May 20, 2024

See #112 for more detailed explanation.

from relay.

devknoll avatar devknoll commented on May 20, 2024

Thanks yuzhi. I'll close this one so the discussion can move there!

from relay.

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.