UNPKG

@directus/api

Version:

Directus is a real-time API and App dashboard for managing SQL database content

33 lines (32 loc) 1.35 kB
import type { SchemaOverview } from '@directus/types'; import { GraphQLSchema } from 'graphql'; import type { ObjectTypeComposer } from 'graphql-compose'; import { type FieldMap } from '../../../permissions/modules/fetch-allowed-field-map/fetch-allowed-field-map.js'; import { GraphQLService } from '../index.js'; export type Schema = { read: SchemaOverview; create: SchemaOverview; update: SchemaOverview; delete: SchemaOverview; }; export type InconsistentFields = { read: FieldMap; create: FieldMap; update: FieldMap; delete: FieldMap; }; export type CollectionTypes = { CreateCollectionTypes: Record<string, ObjectTypeComposer<any, any>>; ReadCollectionTypes: Record<string, ObjectTypeComposer<any, any>>; UpdateCollectionTypes: Record<string, ObjectTypeComposer<any, any>>; DeleteCollectionTypes: Record<string, ObjectTypeComposer<any, any>>; }; /** * These should be ignored in the context of GraphQL, and/or are replaced by a custom resolver (for non-standard structures) */ export declare const SYSTEM_DENY_LIST: string[]; export declare const READ_ONLY: string[]; /** * Generate the GraphQL schema. Pulls from the schema information generated by the get-schema util. */ export declare function generateSchema(gql: GraphQLService, type?: 'schema' | 'sdl'): Promise<GraphQLSchema | string>;