getIntrospectionQuery.d.ts 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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. }
  17. export function getIntrospectionQuery(options?: IntrospectionOptions): string;
  18. export interface IntrospectionQuery {
  19. readonly __schema: IntrospectionSchema;
  20. }
  21. export interface IntrospectionSchema {
  22. readonly queryType: IntrospectionNamedTypeRef<IntrospectionObjectType>;
  23. readonly mutationType: Maybe<
  24. IntrospectionNamedTypeRef<IntrospectionObjectType>
  25. >;
  26. readonly subscriptionType: Maybe<
  27. IntrospectionNamedTypeRef<IntrospectionObjectType>
  28. >;
  29. readonly types: ReadonlyArray<IntrospectionType>;
  30. readonly directives: ReadonlyArray<IntrospectionDirective>;
  31. }
  32. export type IntrospectionType =
  33. | IntrospectionScalarType
  34. | IntrospectionObjectType
  35. | IntrospectionInterfaceType
  36. | IntrospectionUnionType
  37. | IntrospectionEnumType
  38. | IntrospectionInputObjectType;
  39. export type IntrospectionOutputType =
  40. | IntrospectionScalarType
  41. | IntrospectionObjectType
  42. | IntrospectionInterfaceType
  43. | IntrospectionUnionType
  44. | IntrospectionEnumType;
  45. export type IntrospectionInputType =
  46. | IntrospectionScalarType
  47. | IntrospectionEnumType
  48. | IntrospectionInputObjectType;
  49. export interface IntrospectionScalarType {
  50. readonly kind: 'SCALAR';
  51. readonly name: string;
  52. readonly description?: Maybe<string>;
  53. readonly specifiedByUrl?: Maybe<string>;
  54. }
  55. export interface IntrospectionObjectType {
  56. readonly kind: 'OBJECT';
  57. readonly name: string;
  58. readonly description?: Maybe<string>;
  59. readonly fields: ReadonlyArray<IntrospectionField>;
  60. readonly interfaces: ReadonlyArray<
  61. IntrospectionNamedTypeRef<IntrospectionInterfaceType>
  62. >;
  63. }
  64. export interface IntrospectionInterfaceType {
  65. readonly kind: 'INTERFACE';
  66. readonly name: string;
  67. readonly description?: Maybe<string>;
  68. readonly fields: ReadonlyArray<IntrospectionField>;
  69. readonly interfaces: ReadonlyArray<
  70. IntrospectionNamedTypeRef<IntrospectionInterfaceType>
  71. >;
  72. readonly possibleTypes: ReadonlyArray<
  73. IntrospectionNamedTypeRef<IntrospectionObjectType>
  74. >;
  75. }
  76. export interface IntrospectionUnionType {
  77. readonly kind: 'UNION';
  78. readonly name: string;
  79. readonly description?: Maybe<string>;
  80. readonly possibleTypes: ReadonlyArray<
  81. IntrospectionNamedTypeRef<IntrospectionObjectType>
  82. >;
  83. }
  84. export interface IntrospectionEnumType {
  85. readonly kind: 'ENUM';
  86. readonly name: string;
  87. readonly description?: Maybe<string>;
  88. readonly enumValues: ReadonlyArray<IntrospectionEnumValue>;
  89. }
  90. export interface IntrospectionInputObjectType {
  91. readonly kind: 'INPUT_OBJECT';
  92. readonly name: string;
  93. readonly description?: Maybe<string>;
  94. readonly inputFields: ReadonlyArray<IntrospectionInputValue>;
  95. }
  96. export interface IntrospectionListTypeRef<
  97. T extends IntrospectionTypeRef = IntrospectionTypeRef
  98. > {
  99. readonly kind: 'LIST';
  100. readonly ofType: T;
  101. }
  102. export interface IntrospectionNonNullTypeRef<
  103. T extends IntrospectionTypeRef = IntrospectionTypeRef
  104. > {
  105. readonly kind: 'NON_NULL';
  106. readonly ofType: T;
  107. }
  108. export type IntrospectionTypeRef =
  109. | IntrospectionNamedTypeRef
  110. | IntrospectionListTypeRef<any>
  111. | IntrospectionNonNullTypeRef<
  112. IntrospectionNamedTypeRef | IntrospectionListTypeRef<any>
  113. >;
  114. export type IntrospectionOutputTypeRef =
  115. | IntrospectionNamedTypeRef<IntrospectionOutputType>
  116. | IntrospectionListTypeRef<any>
  117. | IntrospectionNonNullTypeRef<
  118. | IntrospectionNamedTypeRef<IntrospectionOutputType>
  119. | IntrospectionListTypeRef<any>
  120. >;
  121. export type IntrospectionInputTypeRef =
  122. | IntrospectionNamedTypeRef<IntrospectionInputType>
  123. | IntrospectionListTypeRef<any>
  124. | IntrospectionNonNullTypeRef<
  125. | IntrospectionNamedTypeRef<IntrospectionInputType>
  126. | IntrospectionListTypeRef<any>
  127. >;
  128. export interface IntrospectionNamedTypeRef<
  129. T extends IntrospectionType = IntrospectionType
  130. > {
  131. readonly kind: T['kind'];
  132. readonly name: string;
  133. }
  134. export interface IntrospectionField {
  135. readonly name: string;
  136. readonly description?: Maybe<string>;
  137. readonly args: ReadonlyArray<IntrospectionInputValue>;
  138. readonly type: IntrospectionOutputTypeRef;
  139. readonly isDeprecated: boolean;
  140. readonly deprecationReason?: Maybe<string>;
  141. }
  142. export interface IntrospectionInputValue {
  143. readonly name: string;
  144. readonly description?: Maybe<string>;
  145. readonly type: IntrospectionInputTypeRef;
  146. readonly defaultValue?: Maybe<string>;
  147. }
  148. export interface IntrospectionEnumValue {
  149. readonly name: string;
  150. readonly description?: Maybe<string>;
  151. readonly isDeprecated: boolean;
  152. readonly deprecationReason?: Maybe<string>;
  153. }
  154. export interface IntrospectionDirective {
  155. readonly name: string;
  156. readonly description?: Maybe<string>;
  157. readonly isRepeatable?: boolean;
  158. readonly locations: ReadonlyArray<DirectiveLocationEnum>;
  159. readonly args: ReadonlyArray<IntrospectionInputValue>;
  160. }