gatsby-source-sanity
Version:
Gatsby source plugin for building websites using Sanity.io as a backend.
20 lines (19 loc) • 960 B
TypeScript
import { Actions, NodePluginArgs } from 'gatsby';
import { SanityDocument } from '../types/sanity';
import { TypeMap } from './remoteGraphQLSchema';
import { SanityInputNode } from '../types/gatsby';
import { SanityClient } from '@sanity/client';
export declare const RESTRICTED_NODE_FIELDS: string[];
export interface ProcessingOptions {
typeMap: TypeMap;
createNode: Actions['createNode'];
createNodeId: NodePluginArgs['createNodeId'];
createContentDigest: NodePluginArgs['createContentDigest'];
createParentChildLink: Actions['createParentChildLink'];
overlayDrafts: boolean;
client: SanityClient;
typePrefix?: string;
}
export declare function toGatsbyNode(doc: SanityDocument, options: ProcessingOptions): SanityInputNode;
export declare function getTypeName(type: string, typePrefix: string | undefined): string;
export declare function getConflictFreeFieldName(fieldName: string, typePrefix: string | undefined): string;