getIntrospectionQuery.d.ts 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. import { Maybe } from '../jsutils/Maybe';
  2. import { DirectiveLocationEnum } from '../language/directiveLocation';
  3. export interface IntrospectionOptions {
  4. // Whether to include descriptions in the introspection result.
  5. // Default: true
  6. descriptions?: boolean;
  7. // Whether to include `specifiedByUrl` in the introspection result.
  8. // Default: false
  9. specifiedByUrl?: boolean;
  10. // Whether to include `isRepeatable` flag on directives.
  11. // Default: false
  12. directiveIsRepeatable?: boolean;
  13. // Whether to include `description` field on schema.
  14. // Default: false
  15. schemaDescription?: boolean;
  16. // Whether target GraphQL server support deprecation of input values.
  17. // Default: false
  18. inputValueDeprecation?: boolean;
  19. }
  20. export function getIntrospectionQuery(options?: IntrospectionOptions): string;
  21. export interface IntrospectionQuery {
  22. readonly __schema: IntrospectionSchema;
  23. }
  24. export interface IntrospectionSchema {
  25. readonly queryType: IntrospectionNamedTypeRef<IntrospectionObjectType>;
  26. readonly mutationType: Maybe<
  27. IntrospectionNamedTypeRef<IntrospectionObjectType>
  28. >;
  29. readonly subscriptionType: Maybe<
  30. IntrospectionNamedTypeRef<IntrospectionObjectType>
  31. >;
  32. readonly types: ReadonlyArray<IntrospectionType>;
  33. readonly directives: ReadonlyArray<IntrospectionDirective>;
  34. }
  35. export type IntrospectionType =
  36. | IntrospectionScalarType
  37. | IntrospectionObjectType
  38. | IntrospectionInterfaceType
  39. | IntrospectionUnionType
  40. | IntrospectionEnumType
  41. | IntrospectionInputObjectType;
  42. export type IntrospectionOutputType =
  43. | IntrospectionScalarType
  44. | IntrospectionObjectType
  45. | IntrospectionInterfaceType
  46. | IntrospectionUnionType
  47. | IntrospectionEnumType;
  48. export type IntrospectionInputType =
  49. | IntrospectionScalarType
  50. | IntrospectionEnumType
  51. | IntrospectionInputObjectType;
  52. export interface IntrospectionScalarType {
  53. readonly kind: 'SCALAR';
  54. readonly name: string;
  55. readonly description?: Maybe<string>;
  56. readonly specifiedByUrl?: Maybe<string>;
  57. }
  58. export interface IntrospectionObjectType {
  59. readonly kind: 'OBJECT';
  60. readonly name: string;
  61. readonly description?: Maybe<string>;
  62. readonly fields: ReadonlyArray<IntrospectionField>;
  63. readonly interfaces: ReadonlyArray<
  64. IntrospectionNamedTypeRef<IntrospectionInterfaceType>
  65. >;
  66. }
  67. export interface IntrospectionInterfaceType {
  68. readonly kind: 'INTERFACE';
  69. readonly name: string;
  70. readonly description?: Maybe<string>;
  71. readonly fields: ReadonlyArray<IntrospectionField>;
  72. readonly interfaces: ReadonlyArray<
  73. IntrospectionNamedTypeRef<IntrospectionInterfaceType>
  74. >;
  75. readonly possibleTypes: ReadonlyArray<
  76. IntrospectionNamedTypeRef<IntrospectionObjectType>
  77. >;
  78. }
  79. export interface IntrospectionUnionType {
  80. readonly kind: 'UNION';
  81. readonly name: string;
  82. readonly description?: Maybe<string>;
  83. readonly possibleTypes: ReadonlyArray<
  84. IntrospectionNamedTypeRef<IntrospectionObjectType>
  85. >;
  86. }
  87. export interface IntrospectionEnumType {
  88. readonly kind: 'ENUM';
  89. readonly name: string;
  90. readonly description?: Maybe<string>;
  91. readonly enumValues: ReadonlyArray<IntrospectionEnumValue>;
  92. }
  93. export interface IntrospectionInputObjectType {
  94. readonly kind: 'INPUT_OBJECT';
  95. readonly name: string;
  96. readonly description?: Maybe<string>;
  97. readonly inputFields: ReadonlyArray<IntrospectionInputValue>;
  98. }
  99. export interface IntrospectionListTypeRef<
  100. T extends IntrospectionTypeRef = IntrospectionTypeRef
  101. > {
  102. readonly kind: 'LIST';
  103. readonly ofType: T;
  104. }
  105. export interface IntrospectionNonNullTypeRef<
  106. T extends IntrospectionTypeRef = IntrospectionTypeRef
  107. > {
  108. readonly kind: 'NON_NULL';
  109. readonly ofType: T;
  110. }
  111. export type IntrospectionTypeRef =
  112. | IntrospectionNamedTypeRef
  113. | IntrospectionListTypeRef<any>
  114. | IntrospectionNonNullTypeRef<
  115. IntrospectionNamedTypeRef | IntrospectionListTypeRef<any>
  116. >;
  117. export type IntrospectionOutputTypeRef =
  118. | IntrospectionNamedTypeRef<IntrospectionOutputType>
  119. | IntrospectionListTypeRef<any>
  120. | IntrospectionNonNullTypeRef<
  121. | IntrospectionNamedTypeRef<IntrospectionOutputType>
  122. | IntrospectionListTypeRef<any>
  123. >;
  124. export type IntrospectionInputTypeRef =
  125. | IntrospectionNamedTypeRef<IntrospectionInputType>
  126. | IntrospectionListTypeRef<any>
  127. | IntrospectionNonNullTypeRef<
  128. | IntrospectionNamedTypeRef<IntrospectionInputType>
  129. | IntrospectionListTypeRef<any>
  130. >;
  131. export interface IntrospectionNamedTypeRef<
  132. T extends IntrospectionType = IntrospectionType
  133. > {
  134. readonly kind: T['kind'];
  135. readonly name: string;
  136. }
  137. export interface IntrospectionField {
  138. readonly name: string;
  139. readonly description?: Maybe<string>;
  140. readonly args: ReadonlyArray<IntrospectionInputValue>;
  141. readonly type: IntrospectionOutputTypeRef;
  142. readonly isDeprecated: boolean;
  143. readonly deprecationReason?: Maybe<string>;
  144. }
  145. export interface IntrospectionInputValue {
  146. readonly name: string;
  147. readonly description?: Maybe<string>;
  148. readonly type: IntrospectionInputTypeRef;
  149. readonly defaultValue?: Maybe<string>;
  150. readonly isDeprecated?: boolean;
  151. readonly deprecationReason?: Maybe<string>;
  152. }
  153. export interface IntrospectionEnumValue {
  154. readonly name: string;
  155. readonly description?: Maybe<string>;
  156. readonly isDeprecated: boolean;
  157. readonly deprecationReason?: Maybe<string>;
  158. }
  159. export interface IntrospectionDirective {
  160. readonly name: string;
  161. readonly description?: Maybe<string>;
  162. readonly isRepeatable?: boolean;
  163. readonly locations: ReadonlyArray<DirectiveLocationEnum>;
  164. readonly args: ReadonlyArray<IntrospectionInputValue>;
  165. }