![]() Provide this option if you want to change the cache size or store the cache information in an alternate location. This is usually sufficient unless the server processes a large number of unique operations. The default documentStore is an InMemoryLRUCache with an approximate size of 30MiB. If it's present, Apollo Server can safely skip parsing and validating the operation, thereby improving performance. Whenever Apollo Server receives an incoming operation, it checks whether that exact operation is present in its documentStore. Note that these rules should depend only on the operation and the schema, not on anything else specific to an individual request, as the result of successful validation is cached across requests.Ī key-value cache that Apollo Server uses to store previously encountered GraphQL operations (as DocumentNodes). ![]() Providing a function is useful if you want to use a different root value depending on the operation's details, such as whether it's a query or mutation.Īn array containing custom functions to use as additional validation rules when validating operations against the schema. The default value is true, unless the NODE_ENV environment variable is set to production.Ī custom resolver that will replace Apollo Server's default field resolvers.Ī value or function called with the parsed Document, creating the root value passed to the GraphQL executor. (It's not needed for the non-Sandbox version of Apollo Studio Explorer, which uses the schema published in the Studio schema registry instead.) This is required to use tools that figure out your server's schema from talking to it directly, like Apollo Sandbox and GraphQL Playground. If true, enables schema introspection by clients. You can use this field to integrate your server with Apollo Gateway. You are using a library that takes a code-first approach (i.e., instead of a schema-first approach) to generate a schema.You are using a function like makeExecutableSchema from graphql-tools to create your schema.You are building a subgraph for Apollo Federation, which uses the buildSubgraphSchema function to generate its schema.Under the hood, Apollo Server automatically generates this field from typeDefs and resolvers. While technically optional, if you are providing typeDefs, it is strongly recommended that you provide resolvers as well.Īn executable GraphQL schema. Can also be an array of multiple maps that are merged. Required unless you provide a schema or a gateway.įor an example, see Define your GraphQL schema.Ī map of functions that populate data for individual schema fields. To generate documents, you can apply the gql tag (from graphql-tag) to valid SDL strings. A valid Schema Definition Language (SDL) string, document, or documents that represent your server's GraphQL schema. Proxy those properties to fields with valid field names. - in case the underlying node data contains field names withĬharacters that are invalid in GraphQL, proxy allows to explicitly.Relative from the path where source node is found. ![]() Theĭifference from link is that this normalizes the relative path to be Arguments by and from, whichĭefine which field to compare to on a remote node and which field to use on Locale options that sets the defaults for this field - run inference on the type and add fields that don’t exist on the. ![]() May be assigned resolver (and other option like args) with additional This behavior can beĬustomised with directives or extensions. With inferred field types, and default field resolvers for Date (whichĪdds formatting options) and File (which resolves the field value asĪ relativePath foreign-key field) are added.
0 Comments
Leave a Reply. |