Skip to content

Add support for sending queries by name #16

Open
@oliemansm

Description

@oliemansm

GraphQLWebClient uses the GraphQLRequest which contains the query to send. That GraphQLRequest object is constructed using the GraphQLRequestBuilder which in turn exposes two ways of defining the query:

  1. String parameter identifying a classpath resource, e.g. some-query-file.graphql
  2. The actual String query

Describe the solution you'd like
Add the ability to send a query (e.g. construct a GraphQLRequest) using named queries. You could add resource file(s) containing named GraphQL queries, e.g.

query getSomeQuery($id: ID!) {
  someQuery(id: $id)
}

Upon startup these queries would be preloaded and they could be used by providing the query name, e.g.

GraphQLRequest.builder().namedQuery("getSomeQuery").build()

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions