import { LiteralObject } from './Literal'; /** * @typedef {object} queryType An gotQL JSON query type * @prop {string} [name] Query name (it is needed when there are multiple queries) * @prop {operation} operation Operation object * @prop {Object.} [variables] Query variables * @prop {string[]} fragments Array of fragments as strings (NOTE: They should be written EXACTLY as the documentation states) * @see https://graphql.org/learn/queries/#fragments * @example for fragments * { operation: { args }, // your args * fragments: [ * `fragment Default on Character { * name * id * }` * ] * } */ export type QueryType = { name?: string; operation: QueryOperation; variables?: Record; fragments?: string[]; }; export type VariableObject = { type: string; value: string; }; /** * @typedef {object} operation An operation object * @prop {string} name Operation name * @prop {Object. | Object.} [args] Operation arguments * @prop {string} [alias] Operation arguments * @prop {Array>} fields Field list */ export type QueryOperation = { name: string; args?: Record; alias?: string; fields: Array; }; type Primitive = string | number | boolean; type OneOrMore = T | T[]; export type ArgObject = { [name: string]: OneOrMore; } | LiteralObject | Array; /** * @typedef {object} fieldObj Field properties * @prop {Array>} [fields] Nested fields */ export type FieldObject = Record; fields: Array; }>; export {}; //# sourceMappingURL=QueryType.d.ts.map