GraphQLStitchedSchema
GraphQLStitchedSchema API reference.
Proto: graphql_stitched_schema.proto
Package: apimanagement.gloo.solo.io
GraphQLStitchedSchemaReport
Field | Description |
---|---|
workspaces | (repeated GraphQLStitchedSchemaReport.WorkspacesEntry ) |
ownerWorkspace | (string )The name of the workspace that owns the GraphQL stitched schema. |
GraphQLStitchedSchemaReport.WorkspacesEntry
Field | Description |
---|---|
key | (string ) |
value | (common.gloo.solo.io.Report ) |
GraphQLStitchedSchemaSpec
Field | Description |
---|---|
subschemas | (repeated GraphQLStitchedSchemaSpec.Subschema )List of GraphQL Subschemas that compose this GraphQL stitched schema. |
options | (GraphQLStitchedSchemaSpec.Options ) |
GraphQLStitchedSchemaSpec.Options
Field | Description |
---|---|
enableIntrospection | (bool )Enable introspection queries on this GraphQL Stitched API. Introspection queries are used by GraphQL developers to understand the schema of the GraphQL API and create queries that are valid against the schema. Introspection is disabled by default, and should be disabled for production environments. |
GraphQLStitchedSchemaSpec.Subschema
Field | Description |
---|---|
schema | (core.skv2.solo.io.ClusterObjectRef )Reference to a GraphQLSchema resource that contains the configuration for this subschema. |
stitchedSchema | (core.skv2.solo.io.ClusterObjectRef )Reference to a GraphQLStitchedSchema resource that contains the configuration for this subschema. |
typeMerge | (repeated GraphQLStitchedSchemaSpec.Subschema.TypeMergeEntry )Type merge configuration for this subschema. |
GraphQLStitchedSchemaSpec.Subschema.TypeMergeConfig
Type merge configuration for this subschema. Let’s say this subschema is a Users service schema and provides the User type (with a query to fetch a user given the username)
type Query {
GetUser(username: String): User
}
type User {
username: String
firstName: String
lastName: String
}
and another subschema, e.g. Reviews schema, may have a partial User type:
type Review {
author: User
}
type User {
username: String
}
We want to provide the relevant information from this Users service schema, so that another API that can give us a partial User type (with the username) will then be able to have access to the full user type. With the correct type merging config under the Users subschema, e.g.:
type_merge:
User:
selection_set: '{ username }'
query_name: 'GetUser'
args:
username: username
the stitched schema will now be able to provide the full user type to all types that require it. In this case, we can now get the first name of an author from the Review.author field even though the Reviews schema doesn’t provide the full User type. Note: Type merging can be used for all GraphQL types except Mutations and Subscriptions.
Note that the args
option specifies the format to turn the initial object representation
into query arguments. For example, consider the following GetUser query:
input UserSearch {
username: String
}
type Query {
GetUser(user_search: UserSearch): User
}
To set the user query argument with the correct username from an object,
you use the args
option, such as the following:
args:
user_search.username: username
where user_search.username
is the “setter” path to set the argument input value at, and
username
is the “extraction” path to extract from an object, such as {"username": "wpatel"}
.
Field | Description |
---|---|
selectionSet | (string )This specifies one or more key fields required from other services to perform this query. Query planning will automatically resolve these fields from other subschemas in dependency order. This is a graphql selection set specified as a string e.g. ‘{ username }’ |
queryName | (string )specifies the root field from this subschema used to request the local type |
args | (repeated GraphQLStitchedSchemaSpec.Subschema.TypeMergeConfig.ArgsEntry )The format to turn the initial object representation into query arguments. |
GraphQLStitchedSchemaSpec.Subschema.TypeMergeConfig.ArgsEntry
Field | Description |
---|---|
key | (string ) |
value | (string ) |
GraphQLStitchedSchemaSpec.Subschema.TypeMergeEntry
Field | Description |
---|---|
key | (string ) |
value | (GraphQLStitchedSchemaSpec.Subschema.TypeMergeConfig ) |
GraphQLStitchedSchemaStatus
Field | Description |
---|---|
common | (common.gloo.solo.io.Status )The state and workspace conditions of the applied resource. |
ownedByWorkspace | (string )The name of the workspace that owns the GraphQL stitched schema. |