apollo-language-server
Version:
A language server for Apollo GraphQL projects
46 lines (41 loc) • 1.25 kB
text/typescript
import { GraphQLDocument } from "../document";
import { Source } from "graphql";
export const apolloClientSchema = `#graphql
"""
Direct the client to resolve this field locally, either from the cache or local resolvers.
"""
directive @client(
"""
When true, the client will never use the cache for this value. See
https://www.apollographql.com/docs/react/essentials/local-state/#forcing-resolvers-with-clientalways-true
"""
always: Boolean
) on FIELD | FRAGMENT_DEFINITION | INLINE_FRAGMENT
"""
Export this locally resolved field as a variable to be used in the remainder of this query. See
https://www.apollographql.com/docs/react/essentials/local-state/#using-client-fields-as-variables
"""
directive @export(
"""
The variable name to export this field as.
"""
as: String!
) on FIELD
"""
Specify a custom store key for this result. See
https://www.apollographql.com/docs/react/advanced/caching/#the-connection-directive
"""
directive @connection(
"""
Specify the store key.
"""
key: String!
"""
An array of query argument names to include in the generated custom store key.
"""
filter: [String!]
) on FIELD
`;
export const apolloClientSchemaDocument = new GraphQLDocument(
new Source(apolloClientSchema)
);