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

Feature: Support for "global" Fragments #276

Open
jasonbahl opened this issue Feb 12, 2024 · 1 comment
Open

Feature: Support for "global" Fragments #276

jasonbahl opened this issue Feb 12, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@jasonbahl
Copy link
Collaborator

As a user I would like to save GraphQL Fragments as standalone documents, then reference those fragments in other queries without needing to include the full fragment. At run-time, the server would be able to use the referenced global fragment.

For example, I could save the following Document:

fragment PostData on Post {
  id
  title
}

Then I should be able to run a query like so:

{
  posts {
    nodes {
      ...PostData
    }
  }
}

and even though the fragment isn't defined inline in the query document, it would still be a valid query because the fragment is a global fragment.

see: wp-graphql/wp-graphql#2979

@jasonbahl jasonbahl added the enhancement New feature or request label Feb 12, 2024
@archoda
Copy link

archoda commented Feb 12, 2024

Awesome. Thank you, @jasonbahl

@jasonbahl jasonbahl transferred this issue from wp-graphql/wpgraphql-ide Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants