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

Single query for all fields #89

Open
pdsmcgavin opened this issue May 20, 2022 · 0 comments
Open

Single query for all fields #89

pdsmcgavin opened this issue May 20, 2022 · 0 comments

Comments

@pdsmcgavin
Copy link

Is there a way to not use custom or selected queries and still get just 1 query for all fields instead of 1 query for every field with each field adding on.

return nestedType.fields.map((field) => {
        const createdField = getField(field, this.schema)
        if (createdField) {
          fields.push(createdField)
        }

        return createQuery({
          fields,
          queryHeader: queryHeader,
          isMutation,
          name,
          operationName,
          variables: this.arguments[query.name],
        })
      })

We end up with multiple queries like

user {
  firstName
}

user {
  firstName
  id
}

user {
  firstName
  id
  lastName
}

Can there be an option to only return the query with all fields please?

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

No branches or pull requests

1 participant