UNPKG

1.28 kBTypeScriptView Raw
1import { GraphQLFieldConfig } from 'gatsby/graphql';
2import { GatsbyContext, GatsbyNode, GatsbyOnNodeTypeContext, GatsbyResolversCreator, GatsbyNodeIdCreator } from './types/gatsby';
3export interface PluginConfig {
4 projectId: string;
5 dataset: string;
6 token?: string;
7 version?: string;
8 graphqlTag: string;
9 overlayDrafts?: boolean;
10 watchMode?: boolean;
11}
12export declare const onPreBootstrap: (context: GatsbyContext, pluginConfig: PluginConfig) => Promise<void>;
13export declare const createResolvers: (context: {
14 createResolvers: GatsbyResolversCreator;
15 createNodeId: GatsbyNodeIdCreator;
16 getNode: (id: string) => GatsbyNode | undefined;
17}, pluginConfig: PluginConfig) => void;
18export declare const createSchemaCustomization: ({ actions }: GatsbyContext, pluginConfig: PluginConfig) => void;
19export declare const sourceNodes: (context: GatsbyContext, pluginConfig: PluginConfig) => Promise<void>;
20export declare const onPreExtractQueries: (context: GatsbyContext, pluginConfig: PluginConfig) => Promise<void>;
21export declare const setFieldsOnGraphQLNodeType: (context: GatsbyContext & GatsbyOnNodeTypeContext, pluginConfig: PluginConfig) => Promise<{
22 [key: string]: GraphQLFieldConfig<any, any, {
23 [argName: string]: any;
24 }>;
25}>;