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

Use "Viewer" instead of "Query" #17

Open
jamsea opened this issue Feb 8, 2018 · 1 comment
Open

Use "Viewer" instead of "Query" #17

jamsea opened this issue Feb 8, 2018 · 1 comment

Comments

@jamsea
Copy link

jamsea commented Feb 8, 2018

Hi,

Great project, just poking around the code trying to glue it to the graphql schema I already have. I noticed you're pulling the Queries from this line of code:

const Queries = schema.definitions.find(obj => obj.name.value === 'Query');

I have Viewer and Root in my schema instead (because of Relay), with Root containing the queries. For example my queries take this shape:

query exampleQuery {
  viewer {
    Organization {
      customer(firstName: "Steve") {
        firstName,
        lastName
      }
    }
  }
}

Any idea how I'd tell graphql-auto-generating-cms to resolve the correct query?

@sarkistlt
Copy link
Owner

thanks. Right now it's not possible, only if you will rewrite schema parser middlewhere to add Relay support. I don't use Relay, don't even have any projects that uses it to play around and see what could be done.
I thing we need separate schema parser for Relay, and we can make as an option when you configure your middlewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants