Files
personal_site/frontend/node_modules/@aws-amplify/graphql-docs-generator/lib/index.d.ts
T

40 lines
1.3 KiB
TypeScript

export { buildSchema } from './generator/utils/loading';
export declare function generateGraphQLDocuments<INCLUDE_META extends boolean>(schema: string, options: {
maxDepth?: number;
useExternalFragmentForS3Object?: boolean;
typenameIntrospection?: boolean;
includeMetaData?: INCLUDE_META;
}): GeneratedOperations<MapValueType<INCLUDE_META>>;
export declare type GraphQLWithMeta = {
/**
* The generated graphql string.
*/
graphql: string;
/**
* E.g., `GetMyModel` or `ListMyModels`.
*
* This is used for generating type names.
*
* `undefined` for fragments.
*/
operationName: string | undefined;
/**
* `undefined` for fragments.
*/
operationType: 'query' | 'mutation' | 'subscription' | undefined;
/**
* E.g., `getMyModel` or `listMyModels`.
*
* It's the name of the operation that lives under Queries, Mutations, or Subscriptions
* in the schema and is generally used as the key + variable name referring to the query.
*/
fieldName: string;
};
export declare type GeneratedOperations<T> = {
queries: Map<string, T>;
mutations: Map<string, T>;
subscriptions: Map<string, T>;
fragments: Map<string, string>;
};
declare type MapValueType<INCLUDE_META extends boolean> = INCLUDE_META extends true ? GraphQLWithMeta : string;