Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delegating to subquery type #848

Closed
terion-name opened this issue Jun 16, 2018 · 3 comments
Closed

Delegating to subquery type #848

terion-name opened this issue Jun 16, 2018 · 3 comments
Labels
docs Focuses on documentation changes good first issue

Comments

@terion-name
Copy link

I understand, that this is possible with delegateToSchema and transforms, but I've tried a lot and no luck, docs and tests on some transformers (like ExractField or WrapQuery) give no idea what they actually do.

Please, can you help with this?

I have a remote schema like this:

type NewsArticle {
      id: ID!
      title: String!
    }
    input NewsWhereInput {
      id: ID
    }
    type NewsQuery {
      articles(where: NewsWhereInput): [NewsArticle]
    }
    type Query {
      News: NewsQuery
    }

And I need to delegate articles query to News {articles}, e.g. delegateToSchema recieves field articles and delegates it News type or remote schema

@ghost ghost added docs Focuses on documentation changes good first issue labels Jun 16, 2018
@NattapongSiri
Copy link

Disclaimer.. I learn this tools for only a week. I don't know much about how this tool work.

You probably need to see this code.
https://launchpad.graphql.com/q5kq9z15p?_ga=2.70448080.1131386757.1529294606-1104484981.1528707742

I adapt that code into my own project and it's working fine.
What confuse me later is... Which resolver take priority than other ?
To me, it seem like the delegated one have highest priority because all my other resolvers got ignored.

@elliottsj
Copy link

This looks like a duplicate of #543. More info there, with some solutions using WrapQuery.

@yaacovCR
Copy link
Collaborator

yaacovCR commented Apr 1, 2020

Closing as is duplicate.

@yaacovCR yaacovCR closed this as completed Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Focuses on documentation changes good first issue
Projects
None yet
Development

No branches or pull requests

4 participants