Skip to content

Feature: Support for "global" Fragments #276

@jasonbahl

Description

@jasonbahl

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: enhancementImprovements to existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions