@graphitation/supermassive 2.6.1 → 3.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/.eslintcache +1 -1
  2. package/CHANGELOG.md +17 -1
  3. package/lib/__testUtils__/execute.d.ts +13 -0
  4. package/lib/__testUtils__/execute.d.ts.map +1 -0
  5. package/lib/__testUtils__/execute.js +196 -0
  6. package/lib/__testUtils__/execute.js.map +7 -0
  7. package/lib/__testUtils__/execute.mjs +174 -0
  8. package/lib/__testUtils__/execute.mjs.map +7 -0
  9. package/lib/benchmarks/index.js +11 -20
  10. package/lib/benchmarks/index.js.map +3 -3
  11. package/lib/benchmarks/index.mjs +12 -23
  12. package/lib/benchmarks/index.mjs.map +2 -2
  13. package/lib/benchmarks/swapi-schema/index.d.ts +4 -2
  14. package/lib/benchmarks/swapi-schema/index.d.ts.map +1 -1
  15. package/lib/benchmarks/swapi-schema/index.js +8 -2
  16. package/lib/benchmarks/swapi-schema/index.js.map +2 -2
  17. package/lib/benchmarks/swapi-schema/index.mjs +8 -2
  18. package/lib/benchmarks/swapi-schema/index.mjs.map +2 -2
  19. package/lib/benchmarks/swapi-schema/makeExecutableSchema.d.ts +7 -0
  20. package/lib/benchmarks/swapi-schema/makeExecutableSchema.d.ts.map +1 -0
  21. package/lib/benchmarks/swapi-schema/makeExecutableSchema.js +916 -0
  22. package/lib/benchmarks/swapi-schema/makeExecutableSchema.js.map +7 -0
  23. package/lib/benchmarks/swapi-schema/makeExecutableSchema.mjs +903 -0
  24. package/lib/benchmarks/swapi-schema/makeExecutableSchema.mjs.map +7 -0
  25. package/lib/benchmarks/swapi-schema/resolvers.d.ts.map +1 -1
  26. package/lib/benchmarks/swapi-schema/resolvers.js +53 -17
  27. package/lib/benchmarks/swapi-schema/resolvers.js.map +2 -2
  28. package/lib/benchmarks/swapi-schema/resolvers.mjs +54 -18
  29. package/lib/benchmarks/swapi-schema/resolvers.mjs.map +2 -2
  30. package/lib/collectFields.d.ts +27 -10
  31. package/lib/collectFields.d.ts.map +1 -1
  32. package/lib/collectFields.js +146 -80
  33. package/lib/collectFields.js.map +3 -3
  34. package/lib/collectFields.mjs +143 -81
  35. package/lib/collectFields.mjs.map +2 -2
  36. package/lib/executeWithSchema.d.ts +1 -1
  37. package/lib/executeWithSchema.d.ts.map +1 -1
  38. package/lib/executeWithSchema.js +7 -13
  39. package/lib/executeWithSchema.js.map +2 -2
  40. package/lib/executeWithSchema.mjs +9 -20
  41. package/lib/executeWithSchema.mjs.map +2 -2
  42. package/lib/executeWithoutSchema.d.ts +53 -16
  43. package/lib/executeWithoutSchema.d.ts.map +1 -1
  44. package/lib/executeWithoutSchema.js +1076 -274
  45. package/lib/executeWithoutSchema.js.map +3 -3
  46. package/lib/executeWithoutSchema.mjs +1092 -281
  47. package/lib/executeWithoutSchema.mjs.map +3 -3
  48. package/lib/index.d.ts +3 -9
  49. package/lib/index.d.ts.map +1 -1
  50. package/lib/index.js +3 -7
  51. package/lib/index.js.map +2 -2
  52. package/lib/index.mjs +3 -10
  53. package/lib/index.mjs.map +2 -2
  54. package/lib/jsutils/AccumulatorMap.d.ts +8 -0
  55. package/lib/jsutils/AccumulatorMap.d.ts.map +1 -0
  56. package/lib/jsutils/AccumulatorMap.js +36 -0
  57. package/lib/jsutils/AccumulatorMap.js.map +7 -0
  58. package/lib/jsutils/AccumulatorMap.mjs +17 -0
  59. package/lib/jsutils/AccumulatorMap.mjs.map +7 -0
  60. package/lib/jsutils/didYouMean.d.ts +1 -2
  61. package/lib/jsutils/didYouMean.d.ts.map +1 -1
  62. package/lib/jsutils/didYouMean.js.map +2 -2
  63. package/lib/jsutils/didYouMean.mjs.map +2 -2
  64. package/lib/jsutils/instanceOf.js.map +2 -2
  65. package/lib/jsutils/instanceOf.mjs.map +2 -2
  66. package/lib/schema/definition.d.ts +95 -0
  67. package/lib/schema/definition.d.ts.map +1 -0
  68. package/lib/schema/definition.js +77 -0
  69. package/lib/schema/definition.js.map +7 -0
  70. package/lib/schema/definition.mjs +58 -0
  71. package/lib/schema/definition.mjs.map +7 -0
  72. package/lib/schema/directives.d.ts +41 -0
  73. package/lib/schema/directives.d.ts.map +1 -0
  74. package/lib/schema/directives.js +82 -0
  75. package/lib/schema/directives.js.map +7 -0
  76. package/lib/schema/directives.mjs +65 -0
  77. package/lib/schema/directives.mjs.map +7 -0
  78. package/lib/schema/fragment.d.ts +41 -0
  79. package/lib/schema/fragment.d.ts.map +1 -0
  80. package/lib/schema/fragment.js +270 -0
  81. package/lib/schema/fragment.js.map +7 -0
  82. package/lib/schema/fragment.mjs +267 -0
  83. package/lib/schema/fragment.mjs.map +7 -0
  84. package/lib/schema/reference.d.ts +12 -0
  85. package/lib/schema/reference.d.ts.map +1 -0
  86. package/lib/schema/reference.js +137 -0
  87. package/lib/schema/reference.js.map +7 -0
  88. package/lib/schema/reference.mjs +118 -0
  89. package/lib/schema/reference.mjs.map +7 -0
  90. package/lib/schema/resolvers.d.ts +9 -0
  91. package/lib/schema/resolvers.d.ts.map +1 -0
  92. package/lib/schema/resolvers.js +47 -0
  93. package/lib/schema/resolvers.js.map +7 -0
  94. package/lib/schema/resolvers.mjs +35 -0
  95. package/lib/schema/resolvers.mjs.map +7 -0
  96. package/lib/subscribeWithSchema.d.ts +3 -2
  97. package/lib/subscribeWithSchema.d.ts.map +1 -1
  98. package/lib/subscribeWithSchema.js +7 -13
  99. package/lib/subscribeWithSchema.js.map +2 -2
  100. package/lib/subscribeWithSchema.mjs +9 -20
  101. package/lib/subscribeWithSchema.mjs.map +2 -2
  102. package/lib/subscribeWithoutSchema.d.ts +3 -35
  103. package/lib/subscribeWithoutSchema.d.ts.map +1 -1
  104. package/lib/subscribeWithoutSchema.js +1 -163
  105. package/lib/subscribeWithoutSchema.js.map +2 -2
  106. package/lib/subscribeWithoutSchema.mjs +2 -175
  107. package/lib/subscribeWithoutSchema.mjs.map +2 -2
  108. package/lib/types.d.ts +71 -29
  109. package/lib/types.d.ts.map +1 -1
  110. package/lib/types.js +14 -0
  111. package/lib/types.js.map +2 -2
  112. package/lib/types.mjs +11 -0
  113. package/lib/types.mjs.map +3 -3
  114. package/lib/utilities/addMinimalViableSchemaToRequestDocument.d.ts +9 -0
  115. package/lib/utilities/addMinimalViableSchemaToRequestDocument.d.ts.map +1 -0
  116. package/lib/utilities/addMinimalViableSchemaToRequestDocument.js +303 -0
  117. package/lib/utilities/addMinimalViableSchemaToRequestDocument.js.map +7 -0
  118. package/lib/utilities/addMinimalViableSchemaToRequestDocument.mjs +317 -0
  119. package/lib/utilities/addMinimalViableSchemaToRequestDocument.mjs.map +7 -0
  120. package/lib/utilities/annotateDocumentGraphQLTransform.d.ts +3 -0
  121. package/lib/utilities/annotateDocumentGraphQLTransform.d.ts.map +1 -0
  122. package/lib/utilities/annotateDocumentGraphQLTransform.js +34 -0
  123. package/lib/utilities/annotateDocumentGraphQLTransform.js.map +7 -0
  124. package/lib/utilities/annotateDocumentGraphQLTransform.mjs +17 -0
  125. package/lib/utilities/annotateDocumentGraphQLTransform.mjs.map +7 -0
  126. package/lib/utilities/coerceInputValue.d.ts +10 -0
  127. package/lib/utilities/coerceInputValue.d.ts.map +1 -0
  128. package/lib/utilities/coerceInputValue.js +181 -0
  129. package/lib/utilities/coerceInputValue.js.map +7 -0
  130. package/lib/utilities/coerceInputValue.mjs +167 -0
  131. package/lib/utilities/coerceInputValue.mjs.map +7 -0
  132. package/lib/utilities/decodeASTSchema.d.ts +7 -0
  133. package/lib/utilities/decodeASTSchema.d.ts.map +1 -0
  134. package/lib/utilities/decodeASTSchema.js +243 -0
  135. package/lib/utilities/decodeASTSchema.js.map +7 -0
  136. package/lib/utilities/decodeASTSchema.mjs +242 -0
  137. package/lib/utilities/decodeASTSchema.mjs.map +7 -0
  138. package/lib/utilities/encodeASTSchema.d.ts +4 -0
  139. package/lib/utilities/encodeASTSchema.d.ts.map +1 -0
  140. package/lib/utilities/encodeASTSchema.js +122 -0
  141. package/lib/utilities/encodeASTSchema.js.map +7 -0
  142. package/lib/utilities/encodeASTSchema.mjs +105 -0
  143. package/lib/utilities/encodeASTSchema.mjs.map +7 -0
  144. package/lib/utilities/getSchemaFragment.d.ts +4 -0
  145. package/lib/utilities/getSchemaFragment.d.ts.map +1 -0
  146. package/lib/utilities/getSchemaFragment.js +38 -0
  147. package/lib/utilities/getSchemaFragment.js.map +7 -0
  148. package/lib/utilities/getSchemaFragment.mjs +22 -0
  149. package/lib/utilities/getSchemaFragment.mjs.map +7 -0
  150. package/lib/utilities/makeReadableErrorPath.d.ts +3 -0
  151. package/lib/utilities/makeReadableErrorPath.d.ts.map +1 -0
  152. package/lib/utilities/makeReadableErrorPath.js +47 -0
  153. package/lib/utilities/makeReadableErrorPath.js.map +7 -0
  154. package/lib/utilities/makeReadableErrorPath.mjs +28 -0
  155. package/lib/utilities/makeReadableErrorPath.mjs.map +7 -0
  156. package/lib/utilities/mergeDefinitions.d.ts +8 -0
  157. package/lib/utilities/mergeDefinitions.d.ts.map +1 -0
  158. package/lib/utilities/mergeDefinitions.js +126 -0
  159. package/lib/utilities/mergeDefinitions.js.map +7 -0
  160. package/lib/utilities/mergeDefinitions.mjs +114 -0
  161. package/lib/utilities/mergeDefinitions.mjs.map +7 -0
  162. package/lib/utilities/mergeResolvers.d.ts +1 -1
  163. package/lib/utilities/mergeResolvers.d.ts.map +1 -1
  164. package/lib/utilities/mergeResolvers.js.map +2 -2
  165. package/lib/utilities/mergeResolvers.mjs.map +2 -2
  166. package/lib/utilities/typeNameFromAST.d.ts +1 -1
  167. package/lib/utilities/typeNameFromAST.d.ts.map +1 -1
  168. package/lib/utilities/typeNameFromAST.js.map +2 -2
  169. package/lib/utilities/typeNameFromAST.mjs.map +2 -2
  170. package/lib/utilities/valueFromAST.d.ts +27 -0
  171. package/lib/utilities/valueFromAST.d.ts.map +1 -0
  172. package/lib/utilities/valueFromAST.js +139 -0
  173. package/lib/utilities/valueFromAST.js.map +7 -0
  174. package/lib/utilities/valueFromAST.mjs +125 -0
  175. package/lib/utilities/valueFromAST.mjs.map +7 -0
  176. package/lib/utilities/valueFromASTUntyped.d.ts +21 -0
  177. package/lib/utilities/valueFromASTUntyped.d.ts.map +1 -0
  178. package/lib/utilities/valueFromASTUntyped.js +51 -0
  179. package/lib/utilities/valueFromASTUntyped.js.map +7 -0
  180. package/lib/utilities/valueFromASTUntyped.mjs +32 -0
  181. package/lib/utilities/valueFromASTUntyped.mjs.map +7 -0
  182. package/lib/values.d.ts +8 -13
  183. package/lib/values.d.ts.map +1 -1
  184. package/lib/values.js +83 -75
  185. package/lib/values.js.map +2 -2
  186. package/lib/values.mjs +85 -83
  187. package/lib/values.mjs.map +2 -2
  188. package/package.json +8 -9
  189. package/lib/definition.d.ts +0 -7
  190. package/lib/definition.d.ts.map +0 -1
  191. package/lib/definition.js +0 -59
  192. package/lib/definition.js.map +0 -7
  193. package/lib/definition.mjs +0 -40
  194. package/lib/definition.mjs.map +0 -7
  195. package/lib/directives.d.ts +0 -79
  196. package/lib/directives.d.ts.map +0 -1
  197. package/lib/directives.js +0 -160
  198. package/lib/directives.js.map +0 -7
  199. package/lib/directives.mjs +0 -146
  200. package/lib/directives.mjs.map +0 -7
  201. package/lib/extractImplicitTypesRuntime.d.ts +0 -4
  202. package/lib/extractImplicitTypesRuntime.d.ts.map +0 -1
  203. package/lib/extractImplicitTypesRuntime.js +0 -123
  204. package/lib/extractImplicitTypesRuntime.js.map +0 -7
  205. package/lib/extractImplicitTypesRuntime.mjs +0 -114
  206. package/lib/extractImplicitTypesRuntime.mjs.map +0 -7
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/jsutils/didYouMean.ts"],
4
- "sourcesContent": ["const MAX_SUGGESTIONS = 5;\n\n/**\n * Given [ A, B, C ] return ' Did you mean A, B, or C?'.\n */\nexport function didYouMean(suggestions: ReadonlyArray<string>): string;\nexport function didYouMean(\n subMessage: string,\n suggestions: ReadonlyArray<string>,\n): string;\nexport function didYouMean(\n firstArg: string | ReadonlyArray<string>,\n secondArg?: ReadonlyArray<string>,\n) {\n const [subMessage, suggestionsArg] = secondArg\n ? [firstArg as string, secondArg]\n : [undefined, firstArg as ReadonlyArray<string>];\n\n let message = \" Did you mean \";\n if (subMessage) {\n message += subMessage + \" \";\n }\n\n const suggestions = suggestionsArg.map((x) => `\"${x}\"`);\n switch (suggestions.length) {\n case 0:\n return \"\";\n case 1:\n return message + suggestions[0] + \"?\";\n case 2:\n return message + suggestions[0] + \" or \" + suggestions[1] + \"?\";\n }\n\n const selected = suggestions.slice(0, MAX_SUGGESTIONS);\n const lastItem = selected.pop();\n return message + selected.join(\", \") + \", or \" + lastItem + \"?\";\n}\n"],
5
- "mappings": ";AAAA,IAAM,kBAAkB;AAUjB,SAAS,WACd,UACA,WACA;AACA,QAAM,CAAC,YAAY,cAAc,IAAI,YACjC,CAAC,UAAoB,SAAS,IAC9B,CAAC,QAAW,QAAiC;AAEjD,MAAI,UAAU;AACd,MAAI,YAAY;AACd,eAAW,aAAa;AAAA,EAC1B;AAEA,QAAM,cAAc,eAAe,IAAI,CAAC,MAAM,IAAI,IAAI;AACtD,UAAQ,YAAY,QAAQ;AAAA,IAC1B,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO,UAAU,YAAY,CAAC,IAAI;AAAA,IACpC,KAAK;AACH,aAAO,UAAU,YAAY,CAAC,IAAI,SAAS,YAAY,CAAC,IAAI;AAAA,EAChE;AAEA,QAAM,WAAW,YAAY,MAAM,GAAG,eAAe;AACrD,QAAM,WAAW,SAAS,IAAI;AAC9B,SAAO,UAAU,SAAS,KAAK,IAAI,IAAI,UAAU,WAAW;AAC9D;",
4
+ "sourcesContent": ["const MAX_SUGGESTIONS = 5;\n\n/**\n * Given [ A, B, C ] return ' Did you mean A, B, or C?'.\n */\nexport function didYouMean(\n firstArg: string | ReadonlyArray<string>,\n secondArg?: ReadonlyArray<string>,\n): string {\n const [subMessage, suggestionsArg] = secondArg\n ? [firstArg as string, secondArg]\n : [undefined, firstArg as ReadonlyArray<string>];\n\n let message = \" Did you mean \";\n if (subMessage) {\n message += subMessage + \" \";\n }\n\n const suggestions = suggestionsArg.map((x) => `\"${x}\"`);\n switch (suggestions.length) {\n case 0:\n return \"\";\n case 1:\n return message + suggestions[0] + \"?\";\n case 2:\n return message + suggestions[0] + \" or \" + suggestions[1] + \"?\";\n }\n\n const selected = suggestions.slice(0, MAX_SUGGESTIONS);\n const lastItem = selected.pop();\n return message + selected.join(\", \") + \", or \" + lastItem + \"?\";\n}\n"],
5
+ "mappings": ";AAAA,IAAM,kBAAkB;AAKjB,SAAS,WACd,UACA,WACQ;AACR,QAAM,CAAC,YAAY,cAAc,IAAI,YACjC,CAAC,UAAoB,SAAS,IAC9B,CAAC,QAAW,QAAiC;AAEjD,MAAI,UAAU;AACd,MAAI,YAAY;AACd,eAAW,aAAa;AAAA,EAC1B;AAEA,QAAM,cAAc,eAAe,IAAI,CAAC,MAAM,IAAI,IAAI;AACtD,UAAQ,YAAY,QAAQ;AAAA,IAC1B,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO,UAAU,YAAY,CAAC,IAAI;AAAA,IACpC,KAAK;AACH,aAAO,UAAU,YAAY,CAAC,IAAI,SAAS,YAAY,CAAC,IAAI;AAAA,EAChE;AAEA,QAAM,WAAW,YAAY,MAAM,GAAG,eAAe;AACrD,QAAM,WAAW,SAAS,IAAI;AAC9B,SAAO,UAAU,SAAS,KAAK,IAAI,IAAI,UAAU,WAAW;AAC9D;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/jsutils/instanceOf.ts"],
4
- "sourcesContent": ["import { inspect } from \"./inspect\";\n\n/**\n * A replacement for instanceof which includes an error warning when multi-realm\n * constructors are detected.\n * See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production\n * See: https://webpack.js.org/guides/production/\n */\nexport const instanceOf: (value: unknown, constructor: Constructor) => boolean =\n process.env.NODE_ENV === \"production\"\n ? // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n function instanceOf(value: unknown, constructor: Constructor): boolean {\n return value instanceof constructor;\n }\n : function instanceOf(value: unknown, constructor: Constructor): boolean {\n if (value instanceof constructor) {\n return true;\n }\n if (typeof value === \"object\" && value !== null) {\n // Prefer Symbol.toStringTag since it is immune to minification.\n const className = constructor.prototype[Symbol.toStringTag];\n const valueClassName =\n // We still need to support constructor's name to detect conflicts with older versions of this library.\n Symbol.toStringTag in value\n ? (value as any)[Symbol.toStringTag] // TS bug see, https://github.com/microsoft/TypeScript/issues/38009\n : value.constructor?.name;\n if (className === valueClassName) {\n const stringifiedValue = inspect(value);\n throw new Error(\n `Cannot use ${className} \"${stringifiedValue}\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`,\n );\n }\n }\n return false;\n };\n\ninterface Constructor extends Function {\n prototype: {\n [Symbol.toStringTag]: string;\n };\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAwB;AAQjB,MAAM,aACX;AAAA;AAAA,EAEI,SAASA,YAAW,OAAgB,aAAmC;AACrE,WAAO,iBAAiB;AAAA,EAC1B;AAAA,IACA,SAASA,YAAW,OAAgB,aAAmC;AAd7E;AAeQ,MAAI,iBAAiB,aAAa;AAChC,WAAO;AAAA,EACT;AACA,MAAI,OAAO,UAAU,YAAY,UAAU,MAAM;AAE/C,UAAM,YAAY,YAAY,UAAU,OAAO,WAAW;AAC1D,UAAM;AAAA;AAAA,MAEJ,OAAO,eAAe,QACjB,MAAc,OAAO,WAAW,KACjC,WAAM,gBAAN,mBAAmB;AAAA;AACzB,QAAI,cAAc,gBAAgB;AAChC,YAAM,uBAAmB,wBAAQ,KAAK;AACtC,YAAM,IAAI;AAAA,QACR,cAAc,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAY9B;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;",
4
+ "sourcesContent": ["import { inspect } from \"./inspect\";\n\n/**\n * A replacement for instanceof which includes an error warning when multi-realm\n * constructors are detected.\n * See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production\n * See: https://webpack.js.org/guides/production/\n */\nexport const instanceOf: (value: unknown, constructor: Constructor) => boolean =\n process.env.NODE_ENV === \"production\"\n ? // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n function instanceOf(value: unknown, constructor: Constructor): boolean {\n return value instanceof constructor;\n }\n : function instanceOf(value: unknown, constructor: Constructor): boolean {\n if (value instanceof constructor) {\n return true;\n }\n if (typeof value === \"object\" && value !== null) {\n // Prefer Symbol.toStringTag since it is immune to minification.\n const className = constructor.prototype[Symbol.toStringTag];\n const valueClassName =\n // We still need to support constructor's name to detect conflicts with older versions of this library.\n Symbol.toStringTag in value\n ? value[Symbol.toStringTag]\n : value.constructor?.name;\n if (className === valueClassName) {\n const stringifiedValue = inspect(value);\n throw new Error(\n `Cannot use ${className} \"${stringifiedValue}\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`,\n );\n }\n }\n return false;\n };\n\ninterface Constructor extends Function {\n prototype: {\n [Symbol.toStringTag]: string;\n };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAwB;AAQjB,MAAM,aACX;AAAA;AAAA,EAEI,SAASA,YAAW,OAAgB,aAAmC;AACrE,WAAO,iBAAiB;AAAA,EAC1B;AAAA,IACA,SAASA,YAAW,OAAgB,aAAmC;AAd7E;AAeQ,MAAI,iBAAiB,aAAa;AAChC,WAAO;AAAA,EACT;AACA,MAAI,OAAO,UAAU,YAAY,UAAU,MAAM;AAE/C,UAAM,YAAY,YAAY,UAAU,OAAO,WAAW;AAC1D,UAAM;AAAA;AAAA,MAEJ,OAAO,eAAe,QAClB,MAAM,OAAO,WAAW,KACxB,WAAM,gBAAN,mBAAmB;AAAA;AACzB,QAAI,cAAc,gBAAgB;AAChC,YAAM,uBAAmB,wBAAQ,KAAK;AACtC,YAAM,IAAI;AAAA,QACR,cAAc,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAY9B;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;",
6
6
  "names": ["instanceOf"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/jsutils/instanceOf.ts"],
4
- "sourcesContent": ["import { inspect } from \"./inspect\";\n\n/**\n * A replacement for instanceof which includes an error warning when multi-realm\n * constructors are detected.\n * See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production\n * See: https://webpack.js.org/guides/production/\n */\nexport const instanceOf: (value: unknown, constructor: Constructor) => boolean =\n process.env.NODE_ENV === \"production\"\n ? // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n function instanceOf(value: unknown, constructor: Constructor): boolean {\n return value instanceof constructor;\n }\n : function instanceOf(value: unknown, constructor: Constructor): boolean {\n if (value instanceof constructor) {\n return true;\n }\n if (typeof value === \"object\" && value !== null) {\n // Prefer Symbol.toStringTag since it is immune to minification.\n const className = constructor.prototype[Symbol.toStringTag];\n const valueClassName =\n // We still need to support constructor's name to detect conflicts with older versions of this library.\n Symbol.toStringTag in value\n ? (value as any)[Symbol.toStringTag] // TS bug see, https://github.com/microsoft/TypeScript/issues/38009\n : value.constructor?.name;\n if (className === valueClassName) {\n const stringifiedValue = inspect(value);\n throw new Error(\n `Cannot use ${className} \"${stringifiedValue}\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`,\n );\n }\n }\n return false;\n };\n\ninterface Constructor extends Function {\n prototype: {\n [Symbol.toStringTag]: string;\n };\n}\n"],
5
- "mappings": ";AAAA,SAAS,eAAe;AAQjB,IAAM,aACX;AAAA;AAAA,EAEI,SAASA,YAAW,OAAgB,aAAmC;AACrE,WAAO,iBAAiB;AAAA,EAC1B;AAAA,IACA,SAASA,YAAW,OAAgB,aAAmC;AAd7E;AAeQ,MAAI,iBAAiB,aAAa;AAChC,WAAO;AAAA,EACT;AACA,MAAI,OAAO,UAAU,YAAY,UAAU,MAAM;AAE/C,UAAM,YAAY,YAAY,UAAU,OAAO,WAAW;AAC1D,UAAM;AAAA;AAAA,MAEJ,OAAO,eAAe,QACjB,MAAc,OAAO,WAAW,KACjC,WAAM,gBAAN,mBAAmB;AAAA;AACzB,QAAI,cAAc,gBAAgB;AAChC,YAAM,mBAAmB,QAAQ,KAAK;AACtC,YAAM,IAAI;AAAA,QACR,cAAc,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAY9B;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;",
4
+ "sourcesContent": ["import { inspect } from \"./inspect\";\n\n/**\n * A replacement for instanceof which includes an error warning when multi-realm\n * constructors are detected.\n * See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production\n * See: https://webpack.js.org/guides/production/\n */\nexport const instanceOf: (value: unknown, constructor: Constructor) => boolean =\n process.env.NODE_ENV === \"production\"\n ? // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n function instanceOf(value: unknown, constructor: Constructor): boolean {\n return value instanceof constructor;\n }\n : function instanceOf(value: unknown, constructor: Constructor): boolean {\n if (value instanceof constructor) {\n return true;\n }\n if (typeof value === \"object\" && value !== null) {\n // Prefer Symbol.toStringTag since it is immune to minification.\n const className = constructor.prototype[Symbol.toStringTag];\n const valueClassName =\n // We still need to support constructor's name to detect conflicts with older versions of this library.\n Symbol.toStringTag in value\n ? value[Symbol.toStringTag]\n : value.constructor?.name;\n if (className === valueClassName) {\n const stringifiedValue = inspect(value);\n throw new Error(\n `Cannot use ${className} \"${stringifiedValue}\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`,\n );\n }\n }\n return false;\n };\n\ninterface Constructor extends Function {\n prototype: {\n [Symbol.toStringTag]: string;\n };\n}\n"],
5
+ "mappings": ";AAAA,SAAS,eAAe;AAQjB,IAAM,aACX;AAAA;AAAA,EAEI,SAASA,YAAW,OAAgB,aAAmC;AACrE,WAAO,iBAAiB;AAAA,EAC1B;AAAA,IACA,SAASA,YAAW,OAAgB,aAAmC;AAd7E;AAeQ,MAAI,iBAAiB,aAAa;AAChC,WAAO;AAAA,EACT;AACA,MAAI,OAAO,UAAU,YAAY,UAAU,MAAM;AAE/C,UAAM,YAAY,YAAY,UAAU,OAAO,WAAW;AAC1D,UAAM;AAAA;AAAA,MAEJ,OAAO,eAAe,QAClB,MAAM,OAAO,WAAW,KACxB,WAAM,gBAAN,mBAAmB;AAAA;AACzB,QAAI,cAAc,gBAAgB;AAChC,YAAM,mBAAmB,QAAQ,KAAK;AACtC,YAAM,IAAI;AAAA,QACR,cAAc,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAY9B;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;",
6
6
  "names": ["instanceOf"]
7
7
  }
@@ -0,0 +1,95 @@
1
+ export type TypeName = string;
2
+ export type SpecTypeIndex = number;
3
+ export type TypeReference = string | SpecTypeIndex;
4
+ export declare const enum TypeKind {
5
+ SCALAR = 1,
6
+ OBJECT = 2,
7
+ INTERFACE = 3,
8
+ UNION = 4,
9
+ ENUM = 5,
10
+ INPUT = 6
11
+ }
12
+ export type ScalarTypeDefinitionTuple = [
13
+ kind: TypeKind.SCALAR
14
+ ];
15
+ export type ObjectTypeDefinitionTuple = [
16
+ kind: TypeKind.OBJECT,
17
+ fields: FieldDefinitionRecord,
18
+ interfaces?: TypeName[]
19
+ ];
20
+ export declare const enum ObjectKeys {
21
+ fields = 1,
22
+ interfaces = 2
23
+ }
24
+ export type InterfaceTypeDefinitionTuple = [
25
+ kind: TypeKind.INTERFACE,
26
+ fields: FieldDefinitionRecord,
27
+ interfaces?: TypeName[]
28
+ ];
29
+ export declare const enum InterfaceKeys {
30
+ fields = 1,
31
+ interfaces = 2
32
+ }
33
+ export type UnionTypeDefinitionTuple = [
34
+ kind: TypeKind.UNION,
35
+ types: TypeName[]
36
+ ];
37
+ export declare const enum UnionKeys {
38
+ types = 1
39
+ }
40
+ export type EnumTypeDefinitionTuple = [
41
+ kind: TypeKind.ENUM,
42
+ values: string[]
43
+ ];
44
+ export declare const enum EnumKeys {
45
+ values = 1
46
+ }
47
+ export type InputObjectTypeDefinitionTuple = [
48
+ kind: TypeKind.INPUT,
49
+ fields: InputValueDefinitionRecord
50
+ ];
51
+ export declare const enum InputObjectKeys {
52
+ fields = 1
53
+ }
54
+ export type TypeDefinitionTuple = ScalarTypeDefinitionTuple | ObjectTypeDefinitionTuple | InterfaceTypeDefinitionTuple | UnionTypeDefinitionTuple | EnumTypeDefinitionTuple | InputObjectTypeDefinitionTuple;
55
+ export type CompositeTypeTuple = ObjectTypeDefinitionTuple | InterfaceTypeDefinitionTuple | UnionTypeDefinitionTuple;
56
+ export type FieldDefinitionTuple = [
57
+ type: TypeReference,
58
+ arguments: InputValueDefinitionRecord
59
+ ];
60
+ export declare const enum FieldKeys {
61
+ type = 0,
62
+ arguments = 1
63
+ }
64
+ export type FieldDefinition = TypeReference | FieldDefinitionTuple;
65
+ export type FieldDefinitionRecord = Record<string, FieldDefinition>;
66
+ export type InputValueDefinitionTuple = [
67
+ type: TypeReference,
68
+ defaultValue: unknown
69
+ ];
70
+ export declare const enum InputValueKeys {
71
+ type = 0,
72
+ defaultValue = 1
73
+ }
74
+ export type InputValueDefinition = TypeReference | InputValueDefinitionTuple;
75
+ export type InputValueDefinitionRecord = Record<string, InputValueDefinition>;
76
+ export type DirectiveName = string;
77
+ export type DirectiveTuple = [
78
+ name: DirectiveName,
79
+ arguments?: Record<string, unknown>
80
+ ];
81
+ export type DirectiveDefinitionTuple = [
82
+ name: DirectiveName,
83
+ arguments?: InputValueDefinitionRecord
84
+ ];
85
+ export declare const enum DirectiveKeys {
86
+ name = 0,
87
+ arguments = 1
88
+ }
89
+ export type TypeDefinitionsRecord = Record<TypeName, TypeDefinitionTuple>;
90
+ export type InterfaceImplementationsRecord = Record<TypeName, TypeName[]>;
91
+ export type SchemaFragmentDefinitions = {
92
+ types: TypeDefinitionsRecord;
93
+ directives?: DirectiveDefinitionTuple[];
94
+ };
95
+ //# sourceMappingURL=definition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/schema/definition.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAC9B,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AACnC,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,aAAa,CAAC;AAGnD,0BAAkB,QAAQ;IACxB,MAAM,IAAI;IACV,MAAM,IAAI;IACV,SAAS,IAAI;IACb,KAAK,IAAI;IACT,IAAI,IAAI;IACR,KAAK,IAAI;CACV;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,QAAQ,CAAC,MAAM;CAEtB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,QAAQ,CAAC,MAAM;IACrB,MAAM,EAAE,qBAAqB;IAC7B,UAAU,CAAC,EAAE,QAAQ,EAAE;CAExB,CAAC;AACF,0BAAkB,UAAU;IAC1B,MAAM,IAAI;IACV,UAAU,IAAI;CACf;AAED,MAAM,MAAM,4BAA4B,GAAG;IACzC,IAAI,EAAE,QAAQ,CAAC,SAAS;IACxB,MAAM,EAAE,qBAAqB;IAC7B,UAAU,CAAC,EAAE,QAAQ,EAAE;CAExB,CAAC;AACF,0BAAkB,aAAa;IAC7B,MAAM,IAAI;IACV,UAAU,IAAI;CACf;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,QAAQ,CAAC,KAAK;IACpB,KAAK,EAAE,QAAQ,EAAE;CAElB,CAAC;AACF,0BAAkB,SAAS;IACzB,KAAK,IAAI;CACV;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,QAAQ,CAAC,IAAI;IACnB,MAAM,EAAE,MAAM,EAAE;CAEjB,CAAC;AACF,0BAAkB,QAAQ;IACxB,MAAM,IAAI;CACX;AAED,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,QAAQ,CAAC,KAAK;IACpB,MAAM,EAAE,0BAA0B;CAEnC,CAAC;AACF,0BAAkB,eAAe;IAC/B,MAAM,IAAI;CACX;AAED,MAAM,MAAM,mBAAmB,GAC3B,yBAAyB,GACzB,yBAAyB,GACzB,4BAA4B,GAC5B,wBAAwB,GACxB,uBAAuB,GACvB,8BAA8B,CAAC;AAEnC,MAAM,MAAM,kBAAkB,GAC1B,yBAAyB,GACzB,4BAA4B,GAC5B,wBAAwB,CAAC;AAE7B,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,aAAa;IACnB,SAAS,EAAE,0BAA0B;CAEtC,CAAC;AACF,0BAAkB,SAAS;IACzB,IAAI,IAAI;IACR,SAAS,IAAI;CACd;AACD,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,oBAAoB,CAAC;AACnE,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAEpE,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,aAAa;IACnB,YAAY,EAAE,OAAO;CAEtB,CAAC;AACF,0BAAkB,cAAc;IAC9B,IAAI,IAAI;IACR,YAAY,IAAI;CACjB;AACD,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG,yBAAyB,CAAC;AAC7E,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;AAE9E,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AACnC,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,aAAa;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CACpC,CAAC;AACF,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,aAAa;IACnB,SAAS,CAAC,EAAE,0BAA0B;CACvC,CAAC;AACF,0BAAkB,aAAa;IAC7B,IAAI,IAAI;IACR,SAAS,IAAI;CACd;AAED,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC;AAC1E,MAAM,MAAM,8BAA8B,GAAG,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;AAE1E,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,qBAAqB,CAAC;IAC7B,UAAU,CAAC,EAAE,wBAAwB,EAAE,CAAC;CAEzC,CAAC"}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var definition_exports = {};
20
+ __export(definition_exports, {
21
+ DirectiveKeys: () => DirectiveKeys,
22
+ EnumKeys: () => EnumKeys,
23
+ FieldKeys: () => FieldKeys,
24
+ InputObjectKeys: () => InputObjectKeys,
25
+ InputValueKeys: () => InputValueKeys,
26
+ InterfaceKeys: () => InterfaceKeys,
27
+ ObjectKeys: () => ObjectKeys,
28
+ TypeKind: () => TypeKind,
29
+ UnionKeys: () => UnionKeys
30
+ });
31
+ module.exports = __toCommonJS(definition_exports);
32
+ var TypeKind = /* @__PURE__ */ ((TypeKind2) => {
33
+ TypeKind2[TypeKind2["SCALAR"] = 1] = "SCALAR";
34
+ TypeKind2[TypeKind2["OBJECT"] = 2] = "OBJECT";
35
+ TypeKind2[TypeKind2["INTERFACE"] = 3] = "INTERFACE";
36
+ TypeKind2[TypeKind2["UNION"] = 4] = "UNION";
37
+ TypeKind2[TypeKind2["ENUM"] = 5] = "ENUM";
38
+ TypeKind2[TypeKind2["INPUT"] = 6] = "INPUT";
39
+ return TypeKind2;
40
+ })(TypeKind || {});
41
+ var ObjectKeys = /* @__PURE__ */ ((ObjectKeys2) => {
42
+ ObjectKeys2[ObjectKeys2["fields"] = 1] = "fields";
43
+ ObjectKeys2[ObjectKeys2["interfaces"] = 2] = "interfaces";
44
+ return ObjectKeys2;
45
+ })(ObjectKeys || {});
46
+ var InterfaceKeys = /* @__PURE__ */ ((InterfaceKeys2) => {
47
+ InterfaceKeys2[InterfaceKeys2["fields"] = 1] = "fields";
48
+ InterfaceKeys2[InterfaceKeys2["interfaces"] = 2] = "interfaces";
49
+ return InterfaceKeys2;
50
+ })(InterfaceKeys || {});
51
+ var UnionKeys = /* @__PURE__ */ ((UnionKeys2) => {
52
+ UnionKeys2[UnionKeys2["types"] = 1] = "types";
53
+ return UnionKeys2;
54
+ })(UnionKeys || {});
55
+ var EnumKeys = /* @__PURE__ */ ((EnumKeys2) => {
56
+ EnumKeys2[EnumKeys2["values"] = 1] = "values";
57
+ return EnumKeys2;
58
+ })(EnumKeys || {});
59
+ var InputObjectKeys = /* @__PURE__ */ ((InputObjectKeys2) => {
60
+ InputObjectKeys2[InputObjectKeys2["fields"] = 1] = "fields";
61
+ return InputObjectKeys2;
62
+ })(InputObjectKeys || {});
63
+ var FieldKeys = /* @__PURE__ */ ((FieldKeys2) => {
64
+ FieldKeys2[FieldKeys2["type"] = 0] = "type";
65
+ FieldKeys2[FieldKeys2["arguments"] = 1] = "arguments";
66
+ return FieldKeys2;
67
+ })(FieldKeys || {});
68
+ var InputValueKeys = /* @__PURE__ */ ((InputValueKeys2) => {
69
+ InputValueKeys2[InputValueKeys2["type"] = 0] = "type";
70
+ InputValueKeys2[InputValueKeys2["defaultValue"] = 1] = "defaultValue";
71
+ return InputValueKeys2;
72
+ })(InputValueKeys || {});
73
+ var DirectiveKeys = /* @__PURE__ */ ((DirectiveKeys2) => {
74
+ DirectiveKeys2[DirectiveKeys2["name"] = 0] = "name";
75
+ DirectiveKeys2[DirectiveKeys2["arguments"] = 1] = "arguments";
76
+ return DirectiveKeys2;
77
+ })(DirectiveKeys || {});
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/schema/definition.ts"],
4
+ "sourcesContent": ["export type TypeName = string; // name without wrappers, i.e. \"MyType\", but not \"[MyType]\"\nexport type SpecTypeIndex = number;\nexport type TypeReference = string | SpecTypeIndex; // e.g. \"ComplexType\" | \"ComplexType!\" | \"[ComplexType!]\" | 4 (i.e. \"ID\")\n\n// Perf: const enums are inlined in the build (+small integers are stored on the stack in v8)\nexport const enum TypeKind {\n SCALAR = 1,\n OBJECT = 2,\n INTERFACE = 3,\n UNION = 4,\n ENUM = 5,\n INPUT = 6,\n}\n\nexport type ScalarTypeDefinitionTuple = [\n kind: TypeKind.SCALAR,\n // directives?: DirectiveTuple[], // TODO ?\n];\n\nexport type ObjectTypeDefinitionTuple = [\n kind: TypeKind.OBJECT,\n fields: FieldDefinitionRecord,\n interfaces?: TypeName[],\n // directives?: DirectiveTuple[],\n];\nexport const enum ObjectKeys {\n fields = 1,\n interfaces = 2,\n}\n\nexport type InterfaceTypeDefinitionTuple = [\n kind: TypeKind.INTERFACE,\n fields: FieldDefinitionRecord,\n interfaces?: TypeName[],\n // directives?: DirectiveTuple[],\n];\nexport const enum InterfaceKeys {\n fields = 1,\n interfaces = 2,\n}\n\nexport type UnionTypeDefinitionTuple = [\n kind: TypeKind.UNION,\n types: TypeName[],\n // directives?: DirectiveTuple[],\n];\nexport const enum UnionKeys {\n types = 1,\n}\n\nexport type EnumTypeDefinitionTuple = [\n kind: TypeKind.ENUM,\n values: string[],\n // directives?: DirectiveTuple[],\n];\nexport const enum EnumKeys {\n values = 1,\n}\n\nexport type InputObjectTypeDefinitionTuple = [\n kind: TypeKind.INPUT,\n fields: InputValueDefinitionRecord,\n // directives?: DirectiveTuple[],\n];\nexport const enum InputObjectKeys {\n fields = 1,\n}\n\nexport type TypeDefinitionTuple =\n | ScalarTypeDefinitionTuple\n | ObjectTypeDefinitionTuple\n | InterfaceTypeDefinitionTuple\n | UnionTypeDefinitionTuple\n | EnumTypeDefinitionTuple\n | InputObjectTypeDefinitionTuple;\n\nexport type CompositeTypeTuple =\n | ObjectTypeDefinitionTuple\n | InterfaceTypeDefinitionTuple\n | UnionTypeDefinitionTuple;\n\nexport type FieldDefinitionTuple = [\n type: TypeReference,\n arguments: InputValueDefinitionRecord,\n // directives?: DirectiveTuple[],\n];\nexport const enum FieldKeys {\n type = 0,\n arguments = 1,\n}\nexport type FieldDefinition = TypeReference | FieldDefinitionTuple;\nexport type FieldDefinitionRecord = Record<string, FieldDefinition>;\n\nexport type InputValueDefinitionTuple = [\n type: TypeReference,\n defaultValue: unknown,\n // directives?: DirectiveTuple[],\n];\nexport const enum InputValueKeys {\n type = 0,\n defaultValue = 1,\n}\nexport type InputValueDefinition = TypeReference | InputValueDefinitionTuple;\nexport type InputValueDefinitionRecord = Record<string, InputValueDefinition>;\n\nexport type DirectiveName = string;\nexport type DirectiveTuple = [\n name: DirectiveName,\n arguments?: Record<string, unknown>, // JS values (cannot be a variable inside schema definition, so it is fine)\n];\nexport type DirectiveDefinitionTuple = [\n name: DirectiveName,\n arguments?: InputValueDefinitionRecord,\n];\nexport const enum DirectiveKeys {\n name = 0,\n arguments = 1,\n}\n\nexport type TypeDefinitionsRecord = Record<TypeName, TypeDefinitionTuple>;\nexport type InterfaceImplementationsRecord = Record<TypeName, TypeName[]>;\n\nexport type SchemaFragmentDefinitions = {\n types: TypeDefinitionsRecord;\n directives?: DirectiveDefinitionTuple[];\n // implementations?: InterfaceImplementationsRecord; // TODO?\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,IAAW,WAAX,kBAAWA,cAAX;AACL,EAAAA,oBAAA,YAAS,KAAT;AACA,EAAAA,oBAAA,YAAS,KAAT;AACA,EAAAA,oBAAA,eAAY,KAAZ;AACA,EAAAA,oBAAA,WAAQ,KAAR;AACA,EAAAA,oBAAA,UAAO,KAAP;AACA,EAAAA,oBAAA,WAAQ,KAAR;AANgB,SAAAA;AAAA,GAAA;AAoBX,IAAW,aAAX,kBAAWC,gBAAX;AACL,EAAAA,wBAAA,YAAS,KAAT;AACA,EAAAA,wBAAA,gBAAa,KAAb;AAFgB,SAAAA;AAAA,GAAA;AAWX,IAAW,gBAAX,kBAAWC,mBAAX;AACL,EAAAA,8BAAA,YAAS,KAAT;AACA,EAAAA,8BAAA,gBAAa,KAAb;AAFgB,SAAAA;AAAA,GAAA;AAUX,IAAW,YAAX,kBAAWC,eAAX;AACL,EAAAA,sBAAA,WAAQ,KAAR;AADgB,SAAAA;AAAA,GAAA;AASX,IAAW,WAAX,kBAAWC,cAAX;AACL,EAAAA,oBAAA,YAAS,KAAT;AADgB,SAAAA;AAAA,GAAA;AASX,IAAW,kBAAX,kBAAWC,qBAAX;AACL,EAAAA,kCAAA,YAAS,KAAT;AADgB,SAAAA;AAAA,GAAA;AAsBX,IAAW,YAAX,kBAAWC,eAAX;AACL,EAAAA,sBAAA,UAAO,KAAP;AACA,EAAAA,sBAAA,eAAY,KAAZ;AAFgB,SAAAA;AAAA,GAAA;AAYX,IAAW,iBAAX,kBAAWC,oBAAX;AACL,EAAAA,gCAAA,UAAO,KAAP;AACA,EAAAA,gCAAA,kBAAe,KAAf;AAFgB,SAAAA;AAAA,GAAA;AAgBX,IAAW,gBAAX,kBAAWC,mBAAX;AACL,EAAAA,8BAAA,UAAO,KAAP;AACA,EAAAA,8BAAA,eAAY,KAAZ;AAFgB,SAAAA;AAAA,GAAA;",
6
+ "names": ["TypeKind", "ObjectKeys", "InterfaceKeys", "UnionKeys", "EnumKeys", "InputObjectKeys", "FieldKeys", "InputValueKeys", "DirectiveKeys"]
7
+ }
@@ -0,0 +1,58 @@
1
+ // src/schema/definition.ts
2
+ var TypeKind = /* @__PURE__ */ ((TypeKind2) => {
3
+ TypeKind2[TypeKind2["SCALAR"] = 1] = "SCALAR";
4
+ TypeKind2[TypeKind2["OBJECT"] = 2] = "OBJECT";
5
+ TypeKind2[TypeKind2["INTERFACE"] = 3] = "INTERFACE";
6
+ TypeKind2[TypeKind2["UNION"] = 4] = "UNION";
7
+ TypeKind2[TypeKind2["ENUM"] = 5] = "ENUM";
8
+ TypeKind2[TypeKind2["INPUT"] = 6] = "INPUT";
9
+ return TypeKind2;
10
+ })(TypeKind || {});
11
+ var ObjectKeys = /* @__PURE__ */ ((ObjectKeys2) => {
12
+ ObjectKeys2[ObjectKeys2["fields"] = 1] = "fields";
13
+ ObjectKeys2[ObjectKeys2["interfaces"] = 2] = "interfaces";
14
+ return ObjectKeys2;
15
+ })(ObjectKeys || {});
16
+ var InterfaceKeys = /* @__PURE__ */ ((InterfaceKeys2) => {
17
+ InterfaceKeys2[InterfaceKeys2["fields"] = 1] = "fields";
18
+ InterfaceKeys2[InterfaceKeys2["interfaces"] = 2] = "interfaces";
19
+ return InterfaceKeys2;
20
+ })(InterfaceKeys || {});
21
+ var UnionKeys = /* @__PURE__ */ ((UnionKeys2) => {
22
+ UnionKeys2[UnionKeys2["types"] = 1] = "types";
23
+ return UnionKeys2;
24
+ })(UnionKeys || {});
25
+ var EnumKeys = /* @__PURE__ */ ((EnumKeys2) => {
26
+ EnumKeys2[EnumKeys2["values"] = 1] = "values";
27
+ return EnumKeys2;
28
+ })(EnumKeys || {});
29
+ var InputObjectKeys = /* @__PURE__ */ ((InputObjectKeys2) => {
30
+ InputObjectKeys2[InputObjectKeys2["fields"] = 1] = "fields";
31
+ return InputObjectKeys2;
32
+ })(InputObjectKeys || {});
33
+ var FieldKeys = /* @__PURE__ */ ((FieldKeys2) => {
34
+ FieldKeys2[FieldKeys2["type"] = 0] = "type";
35
+ FieldKeys2[FieldKeys2["arguments"] = 1] = "arguments";
36
+ return FieldKeys2;
37
+ })(FieldKeys || {});
38
+ var InputValueKeys = /* @__PURE__ */ ((InputValueKeys2) => {
39
+ InputValueKeys2[InputValueKeys2["type"] = 0] = "type";
40
+ InputValueKeys2[InputValueKeys2["defaultValue"] = 1] = "defaultValue";
41
+ return InputValueKeys2;
42
+ })(InputValueKeys || {});
43
+ var DirectiveKeys = /* @__PURE__ */ ((DirectiveKeys2) => {
44
+ DirectiveKeys2[DirectiveKeys2["name"] = 0] = "name";
45
+ DirectiveKeys2[DirectiveKeys2["arguments"] = 1] = "arguments";
46
+ return DirectiveKeys2;
47
+ })(DirectiveKeys || {});
48
+ export {
49
+ DirectiveKeys,
50
+ EnumKeys,
51
+ FieldKeys,
52
+ InputObjectKeys,
53
+ InputValueKeys,
54
+ InterfaceKeys,
55
+ ObjectKeys,
56
+ TypeKind,
57
+ UnionKeys
58
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/schema/definition.ts"],
4
+ "sourcesContent": ["export type TypeName = string; // name without wrappers, i.e. \"MyType\", but not \"[MyType]\"\nexport type SpecTypeIndex = number;\nexport type TypeReference = string | SpecTypeIndex; // e.g. \"ComplexType\" | \"ComplexType!\" | \"[ComplexType!]\" | 4 (i.e. \"ID\")\n\n// Perf: const enums are inlined in the build (+small integers are stored on the stack in v8)\nexport const enum TypeKind {\n SCALAR = 1,\n OBJECT = 2,\n INTERFACE = 3,\n UNION = 4,\n ENUM = 5,\n INPUT = 6,\n}\n\nexport type ScalarTypeDefinitionTuple = [\n kind: TypeKind.SCALAR,\n // directives?: DirectiveTuple[], // TODO ?\n];\n\nexport type ObjectTypeDefinitionTuple = [\n kind: TypeKind.OBJECT,\n fields: FieldDefinitionRecord,\n interfaces?: TypeName[],\n // directives?: DirectiveTuple[],\n];\nexport const enum ObjectKeys {\n fields = 1,\n interfaces = 2,\n}\n\nexport type InterfaceTypeDefinitionTuple = [\n kind: TypeKind.INTERFACE,\n fields: FieldDefinitionRecord,\n interfaces?: TypeName[],\n // directives?: DirectiveTuple[],\n];\nexport const enum InterfaceKeys {\n fields = 1,\n interfaces = 2,\n}\n\nexport type UnionTypeDefinitionTuple = [\n kind: TypeKind.UNION,\n types: TypeName[],\n // directives?: DirectiveTuple[],\n];\nexport const enum UnionKeys {\n types = 1,\n}\n\nexport type EnumTypeDefinitionTuple = [\n kind: TypeKind.ENUM,\n values: string[],\n // directives?: DirectiveTuple[],\n];\nexport const enum EnumKeys {\n values = 1,\n}\n\nexport type InputObjectTypeDefinitionTuple = [\n kind: TypeKind.INPUT,\n fields: InputValueDefinitionRecord,\n // directives?: DirectiveTuple[],\n];\nexport const enum InputObjectKeys {\n fields = 1,\n}\n\nexport type TypeDefinitionTuple =\n | ScalarTypeDefinitionTuple\n | ObjectTypeDefinitionTuple\n | InterfaceTypeDefinitionTuple\n | UnionTypeDefinitionTuple\n | EnumTypeDefinitionTuple\n | InputObjectTypeDefinitionTuple;\n\nexport type CompositeTypeTuple =\n | ObjectTypeDefinitionTuple\n | InterfaceTypeDefinitionTuple\n | UnionTypeDefinitionTuple;\n\nexport type FieldDefinitionTuple = [\n type: TypeReference,\n arguments: InputValueDefinitionRecord,\n // directives?: DirectiveTuple[],\n];\nexport const enum FieldKeys {\n type = 0,\n arguments = 1,\n}\nexport type FieldDefinition = TypeReference | FieldDefinitionTuple;\nexport type FieldDefinitionRecord = Record<string, FieldDefinition>;\n\nexport type InputValueDefinitionTuple = [\n type: TypeReference,\n defaultValue: unknown,\n // directives?: DirectiveTuple[],\n];\nexport const enum InputValueKeys {\n type = 0,\n defaultValue = 1,\n}\nexport type InputValueDefinition = TypeReference | InputValueDefinitionTuple;\nexport type InputValueDefinitionRecord = Record<string, InputValueDefinition>;\n\nexport type DirectiveName = string;\nexport type DirectiveTuple = [\n name: DirectiveName,\n arguments?: Record<string, unknown>, // JS values (cannot be a variable inside schema definition, so it is fine)\n];\nexport type DirectiveDefinitionTuple = [\n name: DirectiveName,\n arguments?: InputValueDefinitionRecord,\n];\nexport const enum DirectiveKeys {\n name = 0,\n arguments = 1,\n}\n\nexport type TypeDefinitionsRecord = Record<TypeName, TypeDefinitionTuple>;\nexport type InterfaceImplementationsRecord = Record<TypeName, TypeName[]>;\n\nexport type SchemaFragmentDefinitions = {\n types: TypeDefinitionsRecord;\n directives?: DirectiveDefinitionTuple[];\n // implementations?: InterfaceImplementationsRecord; // TODO?\n};\n"],
5
+ "mappings": ";AAKO,IAAW,WAAX,kBAAWA,cAAX;AACL,EAAAA,oBAAA,YAAS,KAAT;AACA,EAAAA,oBAAA,YAAS,KAAT;AACA,EAAAA,oBAAA,eAAY,KAAZ;AACA,EAAAA,oBAAA,WAAQ,KAAR;AACA,EAAAA,oBAAA,UAAO,KAAP;AACA,EAAAA,oBAAA,WAAQ,KAAR;AANgB,SAAAA;AAAA,GAAA;AAoBX,IAAW,aAAX,kBAAWC,gBAAX;AACL,EAAAA,wBAAA,YAAS,KAAT;AACA,EAAAA,wBAAA,gBAAa,KAAb;AAFgB,SAAAA;AAAA,GAAA;AAWX,IAAW,gBAAX,kBAAWC,mBAAX;AACL,EAAAA,8BAAA,YAAS,KAAT;AACA,EAAAA,8BAAA,gBAAa,KAAb;AAFgB,SAAAA;AAAA,GAAA;AAUX,IAAW,YAAX,kBAAWC,eAAX;AACL,EAAAA,sBAAA,WAAQ,KAAR;AADgB,SAAAA;AAAA,GAAA;AASX,IAAW,WAAX,kBAAWC,cAAX;AACL,EAAAA,oBAAA,YAAS,KAAT;AADgB,SAAAA;AAAA,GAAA;AASX,IAAW,kBAAX,kBAAWC,qBAAX;AACL,EAAAA,kCAAA,YAAS,KAAT;AADgB,SAAAA;AAAA,GAAA;AAsBX,IAAW,YAAX,kBAAWC,eAAX;AACL,EAAAA,sBAAA,UAAO,KAAP;AACA,EAAAA,sBAAA,eAAY,KAAZ;AAFgB,SAAAA;AAAA,GAAA;AAYX,IAAW,iBAAX,kBAAWC,oBAAX;AACL,EAAAA,gCAAA,UAAO,KAAP;AACA,EAAAA,gCAAA,kBAAe,KAAf;AAFgB,SAAAA;AAAA,GAAA;AAgBX,IAAW,gBAAX,kBAAWC,mBAAX;AACL,EAAAA,8BAAA,UAAO,KAAP;AACA,EAAAA,8BAAA,eAAY,KAAZ;AAFgB,SAAAA;AAAA,GAAA;",
6
+ "names": ["TypeKind", "ObjectKeys", "InterfaceKeys", "UnionKeys", "EnumKeys", "InputObjectKeys", "FieldKeys", "InputValueKeys", "DirectiveKeys"]
7
+ }
@@ -0,0 +1,41 @@
1
+ import { DirectiveDefinitionTuple, DirectiveName } from "./definition";
2
+ /**
3
+ * Used to conditionally include fields or fragments.
4
+ */
5
+ export declare const GraphQLIncludeDirective: DirectiveDefinitionTuple;
6
+ /**
7
+ * Used to conditionally skip (exclude) fields or fragments.
8
+ */
9
+ export declare const GraphQLSkipDirective: DirectiveDefinitionTuple;
10
+ /**
11
+ * Constant string used for default reason for a deprecation.
12
+ */
13
+ export declare const DEFAULT_DEPRECATION_REASON = "No longer supported";
14
+ /**
15
+ * Used to declare element of a GraphQL schema as deprecated.
16
+ */
17
+ export declare const GraphQLDeprecatedDirective: DirectiveDefinitionTuple;
18
+ /**
19
+ * Used to provide a URL for specifying the behaviour of custom scalar definitions.
20
+ */
21
+ export declare const GraphQLSpecifiedByDirective: DirectiveDefinitionTuple;
22
+ /**
23
+ * Used to conditionally defer fragments.
24
+ */
25
+ export declare const GraphQLDeferDirective: DirectiveDefinitionTuple;
26
+ /**
27
+ * Used to conditionally stream list fields.
28
+ */
29
+ export declare const GraphQLStreamDirective: DirectiveDefinitionTuple;
30
+ /**
31
+ * The full list of specified directives.
32
+ */
33
+ export declare const specifiedDirectives: ReadonlyArray<DirectiveDefinitionTuple>;
34
+ export declare const SUPERMASSIVE_SCHEMA_DIRECTIVE_NAME = "schema";
35
+ export declare const SUPERMASSIVE_SCHEMA_DIRECTIVE_FRAGMENT_ARGUMENT_NAME = "fragment";
36
+ /**
37
+ * Used to conditionally stream list fields.
38
+ */
39
+ export declare const SupermassiveSchemaDirective: DirectiveDefinitionTuple;
40
+ export declare function isSpecifiedDirective(directive: DirectiveName | DirectiveDefinitionTuple): boolean;
41
+ //# sourceMappingURL=directives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directives.d.ts","sourceRoot":"","sources":["../../src/schema/directives.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EAExB,aAAa,EACd,MAAM,cAAc,CAAC;AAEtB;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,wBAIrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,wBAGlC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,wBAAwB,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,wBAGxC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,wBAGzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,wBAGnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,wBAGpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,aAAa,CAAC,wBAAwB,CAQpE,CAAC;AAEL,eAAO,MAAM,kCAAkC,WAAW,CAAC;AAC3D,eAAO,MAAM,oDAAoD,aAAa,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,wBAGzC,CAAC;AAEF,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,aAAa,GAAG,wBAAwB,GAClD,OAAO,CAMT"}
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var directives_exports = {};
20
+ __export(directives_exports, {
21
+ DEFAULT_DEPRECATION_REASON: () => DEFAULT_DEPRECATION_REASON,
22
+ GraphQLDeferDirective: () => GraphQLDeferDirective,
23
+ GraphQLDeprecatedDirective: () => GraphQLDeprecatedDirective,
24
+ GraphQLIncludeDirective: () => GraphQLIncludeDirective,
25
+ GraphQLSkipDirective: () => GraphQLSkipDirective,
26
+ GraphQLSpecifiedByDirective: () => GraphQLSpecifiedByDirective,
27
+ GraphQLStreamDirective: () => GraphQLStreamDirective,
28
+ SUPERMASSIVE_SCHEMA_DIRECTIVE_FRAGMENT_ARGUMENT_NAME: () => SUPERMASSIVE_SCHEMA_DIRECTIVE_FRAGMENT_ARGUMENT_NAME,
29
+ SUPERMASSIVE_SCHEMA_DIRECTIVE_NAME: () => SUPERMASSIVE_SCHEMA_DIRECTIVE_NAME,
30
+ SupermassiveSchemaDirective: () => SupermassiveSchemaDirective,
31
+ isSpecifiedDirective: () => isSpecifiedDirective,
32
+ specifiedDirectives: () => specifiedDirectives
33
+ });
34
+ module.exports = __toCommonJS(directives_exports);
35
+ var import_definition = require("./definition");
36
+ const GraphQLIncludeDirective = [
37
+ "include",
38
+ { if: "Boolean!" }
39
+ // TODO: locations for all directives (maybe not - they are irrelevant for runtime)?
40
+ ];
41
+ const GraphQLSkipDirective = [
42
+ "skip",
43
+ { if: "Boolean!" }
44
+ ];
45
+ const DEFAULT_DEPRECATION_REASON = "No longer supported";
46
+ const GraphQLDeprecatedDirective = [
47
+ "deprecated",
48
+ { reason: ["String", DEFAULT_DEPRECATION_REASON] }
49
+ ];
50
+ const GraphQLSpecifiedByDirective = [
51
+ "specifiedBy",
52
+ { url: "String!" }
53
+ ];
54
+ const GraphQLDeferDirective = [
55
+ "defer",
56
+ { if: ["Boolean!", true], label: "String" }
57
+ ];
58
+ const GraphQLStreamDirective = [
59
+ "stream",
60
+ { if: ["Boolean!", true], label: "String", initialCount: ["Int", 0] }
61
+ ];
62
+ const specifiedDirectives = Object.freeze([
63
+ GraphQLIncludeDirective,
64
+ GraphQLSkipDirective,
65
+ GraphQLDeprecatedDirective,
66
+ GraphQLSpecifiedByDirective,
67
+ GraphQLDeferDirective,
68
+ GraphQLStreamDirective
69
+ ]);
70
+ const SUPERMASSIVE_SCHEMA_DIRECTIVE_NAME = "schema";
71
+ const SUPERMASSIVE_SCHEMA_DIRECTIVE_FRAGMENT_ARGUMENT_NAME = "fragment";
72
+ const SupermassiveSchemaDirective = [
73
+ SUPERMASSIVE_SCHEMA_DIRECTIVE_NAME,
74
+ { fragment: "String" }
75
+ // Essentially JSON
76
+ ];
77
+ function isSpecifiedDirective(directive) {
78
+ const name = typeof directive === "string" ? directive : directive[import_definition.DirectiveKeys.name];
79
+ return specifiedDirectives.some(
80
+ (specDirective) => specDirective[import_definition.DirectiveKeys.name] === name
81
+ );
82
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/schema/directives.ts"],
4
+ "sourcesContent": ["import {\n DirectiveDefinitionTuple,\n DirectiveKeys,\n DirectiveName,\n} from \"./definition\";\n\n/**\n * Used to conditionally include fields or fragments.\n */\nexport const GraphQLIncludeDirective: DirectiveDefinitionTuple = [\n \"include\",\n { if: \"Boolean!\" },\n // TODO: locations for all directives (maybe not - they are irrelevant for runtime)?\n];\n\n/**\n * Used to conditionally skip (exclude) fields or fragments.\n */\nexport const GraphQLSkipDirective: DirectiveDefinitionTuple = [\n \"skip\",\n { if: \"Boolean!\" },\n];\n\n/**\n * Constant string used for default reason for a deprecation.\n */\nexport const DEFAULT_DEPRECATION_REASON = \"No longer supported\";\n\n/**\n * Used to declare element of a GraphQL schema as deprecated.\n */\nexport const GraphQLDeprecatedDirective: DirectiveDefinitionTuple = [\n \"deprecated\",\n { reason: [\"String\", DEFAULT_DEPRECATION_REASON] },\n];\n\n/**\n * Used to provide a URL for specifying the behaviour of custom scalar definitions.\n */\nexport const GraphQLSpecifiedByDirective: DirectiveDefinitionTuple = [\n \"specifiedBy\",\n { url: \"String!\" },\n];\n\n/**\n * Used to conditionally defer fragments.\n */\nexport const GraphQLDeferDirective: DirectiveDefinitionTuple = [\n \"defer\",\n { if: [\"Boolean!\", true], label: \"String\" },\n];\n\n/**\n * Used to conditionally stream list fields.\n */\nexport const GraphQLStreamDirective: DirectiveDefinitionTuple = [\n \"stream\",\n { if: [\"Boolean!\", true], label: \"String\", initialCount: [\"Int\", 0] },\n];\n\n/**\n * The full list of specified directives.\n */\nexport const specifiedDirectives: ReadonlyArray<DirectiveDefinitionTuple> =\n Object.freeze([\n GraphQLIncludeDirective,\n GraphQLSkipDirective,\n GraphQLDeprecatedDirective,\n GraphQLSpecifiedByDirective,\n GraphQLDeferDirective,\n GraphQLStreamDirective,\n ]);\n\nexport const SUPERMASSIVE_SCHEMA_DIRECTIVE_NAME = \"schema\";\nexport const SUPERMASSIVE_SCHEMA_DIRECTIVE_FRAGMENT_ARGUMENT_NAME = \"fragment\";\n\n/**\n * Used to conditionally stream list fields.\n */\nexport const SupermassiveSchemaDirective: DirectiveDefinitionTuple = [\n SUPERMASSIVE_SCHEMA_DIRECTIVE_NAME,\n { fragment: \"String\" }, // Essentially JSON\n];\n\nexport function isSpecifiedDirective(\n directive: DirectiveName | DirectiveDefinitionTuple,\n): boolean {\n const name =\n typeof directive === \"string\" ? directive : directive[DirectiveKeys.name];\n return specifiedDirectives.some(\n (specDirective) => specDirective[DirectiveKeys.name] === name,\n );\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAIO;AAKA,MAAM,0BAAoD;AAAA,EAC/D;AAAA,EACA,EAAE,IAAI,WAAW;AAAA;AAEnB;AAKO,MAAM,uBAAiD;AAAA,EAC5D;AAAA,EACA,EAAE,IAAI,WAAW;AACnB;AAKO,MAAM,6BAA6B;AAKnC,MAAM,6BAAuD;AAAA,EAClE;AAAA,EACA,EAAE,QAAQ,CAAC,UAAU,0BAA0B,EAAE;AACnD;AAKO,MAAM,8BAAwD;AAAA,EACnE;AAAA,EACA,EAAE,KAAK,UAAU;AACnB;AAKO,MAAM,wBAAkD;AAAA,EAC7D;AAAA,EACA,EAAE,IAAI,CAAC,YAAY,IAAI,GAAG,OAAO,SAAS;AAC5C;AAKO,MAAM,yBAAmD;AAAA,EAC9D;AAAA,EACA,EAAE,IAAI,CAAC,YAAY,IAAI,GAAG,OAAO,UAAU,cAAc,CAAC,OAAO,CAAC,EAAE;AACtE;AAKO,MAAM,sBACX,OAAO,OAAO;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEI,MAAM,qCAAqC;AAC3C,MAAM,uDAAuD;AAK7D,MAAM,8BAAwD;AAAA,EACnE;AAAA,EACA,EAAE,UAAU,SAAS;AAAA;AACvB;AAEO,SAAS,qBACd,WACS;AACT,QAAM,OACJ,OAAO,cAAc,WAAW,YAAY,UAAU,gCAAc,IAAI;AAC1E,SAAO,oBAAoB;AAAA,IACzB,CAAC,kBAAkB,cAAc,gCAAc,IAAI,MAAM;AAAA,EAC3D;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,65 @@
1
+ // src/schema/directives.ts
2
+ import {
3
+ DirectiveKeys
4
+ } from "./definition.mjs";
5
+ var GraphQLIncludeDirective = [
6
+ "include",
7
+ { if: "Boolean!" }
8
+ // TODO: locations for all directives (maybe not - they are irrelevant for runtime)?
9
+ ];
10
+ var GraphQLSkipDirective = [
11
+ "skip",
12
+ { if: "Boolean!" }
13
+ ];
14
+ var DEFAULT_DEPRECATION_REASON = "No longer supported";
15
+ var GraphQLDeprecatedDirective = [
16
+ "deprecated",
17
+ { reason: ["String", DEFAULT_DEPRECATION_REASON] }
18
+ ];
19
+ var GraphQLSpecifiedByDirective = [
20
+ "specifiedBy",
21
+ { url: "String!" }
22
+ ];
23
+ var GraphQLDeferDirective = [
24
+ "defer",
25
+ { if: ["Boolean!", true], label: "String" }
26
+ ];
27
+ var GraphQLStreamDirective = [
28
+ "stream",
29
+ { if: ["Boolean!", true], label: "String", initialCount: ["Int", 0] }
30
+ ];
31
+ var specifiedDirectives = Object.freeze([
32
+ GraphQLIncludeDirective,
33
+ GraphQLSkipDirective,
34
+ GraphQLDeprecatedDirective,
35
+ GraphQLSpecifiedByDirective,
36
+ GraphQLDeferDirective,
37
+ GraphQLStreamDirective
38
+ ]);
39
+ var SUPERMASSIVE_SCHEMA_DIRECTIVE_NAME = "schema";
40
+ var SUPERMASSIVE_SCHEMA_DIRECTIVE_FRAGMENT_ARGUMENT_NAME = "fragment";
41
+ var SupermassiveSchemaDirective = [
42
+ SUPERMASSIVE_SCHEMA_DIRECTIVE_NAME,
43
+ { fragment: "String" }
44
+ // Essentially JSON
45
+ ];
46
+ function isSpecifiedDirective(directive) {
47
+ const name = typeof directive === "string" ? directive : directive[DirectiveKeys.name];
48
+ return specifiedDirectives.some(
49
+ (specDirective) => specDirective[DirectiveKeys.name] === name
50
+ );
51
+ }
52
+ export {
53
+ DEFAULT_DEPRECATION_REASON,
54
+ GraphQLDeferDirective,
55
+ GraphQLDeprecatedDirective,
56
+ GraphQLIncludeDirective,
57
+ GraphQLSkipDirective,
58
+ GraphQLSpecifiedByDirective,
59
+ GraphQLStreamDirective,
60
+ SUPERMASSIVE_SCHEMA_DIRECTIVE_FRAGMENT_ARGUMENT_NAME,
61
+ SUPERMASSIVE_SCHEMA_DIRECTIVE_NAME,
62
+ SupermassiveSchemaDirective,
63
+ isSpecifiedDirective,
64
+ specifiedDirectives
65
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/schema/directives.ts"],
4
+ "sourcesContent": ["import {\n DirectiveDefinitionTuple,\n DirectiveKeys,\n DirectiveName,\n} from \"./definition\";\n\n/**\n * Used to conditionally include fields or fragments.\n */\nexport const GraphQLIncludeDirective: DirectiveDefinitionTuple = [\n \"include\",\n { if: \"Boolean!\" },\n // TODO: locations for all directives (maybe not - they are irrelevant for runtime)?\n];\n\n/**\n * Used to conditionally skip (exclude) fields or fragments.\n */\nexport const GraphQLSkipDirective: DirectiveDefinitionTuple = [\n \"skip\",\n { if: \"Boolean!\" },\n];\n\n/**\n * Constant string used for default reason for a deprecation.\n */\nexport const DEFAULT_DEPRECATION_REASON = \"No longer supported\";\n\n/**\n * Used to declare element of a GraphQL schema as deprecated.\n */\nexport const GraphQLDeprecatedDirective: DirectiveDefinitionTuple = [\n \"deprecated\",\n { reason: [\"String\", DEFAULT_DEPRECATION_REASON] },\n];\n\n/**\n * Used to provide a URL for specifying the behaviour of custom scalar definitions.\n */\nexport const GraphQLSpecifiedByDirective: DirectiveDefinitionTuple = [\n \"specifiedBy\",\n { url: \"String!\" },\n];\n\n/**\n * Used to conditionally defer fragments.\n */\nexport const GraphQLDeferDirective: DirectiveDefinitionTuple = [\n \"defer\",\n { if: [\"Boolean!\", true], label: \"String\" },\n];\n\n/**\n * Used to conditionally stream list fields.\n */\nexport const GraphQLStreamDirective: DirectiveDefinitionTuple = [\n \"stream\",\n { if: [\"Boolean!\", true], label: \"String\", initialCount: [\"Int\", 0] },\n];\n\n/**\n * The full list of specified directives.\n */\nexport const specifiedDirectives: ReadonlyArray<DirectiveDefinitionTuple> =\n Object.freeze([\n GraphQLIncludeDirective,\n GraphQLSkipDirective,\n GraphQLDeprecatedDirective,\n GraphQLSpecifiedByDirective,\n GraphQLDeferDirective,\n GraphQLStreamDirective,\n ]);\n\nexport const SUPERMASSIVE_SCHEMA_DIRECTIVE_NAME = \"schema\";\nexport const SUPERMASSIVE_SCHEMA_DIRECTIVE_FRAGMENT_ARGUMENT_NAME = \"fragment\";\n\n/**\n * Used to conditionally stream list fields.\n */\nexport const SupermassiveSchemaDirective: DirectiveDefinitionTuple = [\n SUPERMASSIVE_SCHEMA_DIRECTIVE_NAME,\n { fragment: \"String\" }, // Essentially JSON\n];\n\nexport function isSpecifiedDirective(\n directive: DirectiveName | DirectiveDefinitionTuple,\n): boolean {\n const name =\n typeof directive === \"string\" ? directive : directive[DirectiveKeys.name];\n return specifiedDirectives.some(\n (specDirective) => specDirective[DirectiveKeys.name] === name,\n );\n}\n"],
5
+ "mappings": ";AAAA;AAAA,EAEE;AAAA,OAEK;AAKA,IAAM,0BAAoD;AAAA,EAC/D;AAAA,EACA,EAAE,IAAI,WAAW;AAAA;AAEnB;AAKO,IAAM,uBAAiD;AAAA,EAC5D;AAAA,EACA,EAAE,IAAI,WAAW;AACnB;AAKO,IAAM,6BAA6B;AAKnC,IAAM,6BAAuD;AAAA,EAClE;AAAA,EACA,EAAE,QAAQ,CAAC,UAAU,0BAA0B,EAAE;AACnD;AAKO,IAAM,8BAAwD;AAAA,EACnE;AAAA,EACA,EAAE,KAAK,UAAU;AACnB;AAKO,IAAM,wBAAkD;AAAA,EAC7D;AAAA,EACA,EAAE,IAAI,CAAC,YAAY,IAAI,GAAG,OAAO,SAAS;AAC5C;AAKO,IAAM,yBAAmD;AAAA,EAC9D;AAAA,EACA,EAAE,IAAI,CAAC,YAAY,IAAI,GAAG,OAAO,UAAU,cAAc,CAAC,OAAO,CAAC,EAAE;AACtE;AAKO,IAAM,sBACX,OAAO,OAAO;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEI,IAAM,qCAAqC;AAC3C,IAAM,uDAAuD;AAK7D,IAAM,8BAAwD;AAAA,EACnE;AAAA,EACA,EAAE,UAAU,SAAS;AAAA;AACvB;AAEO,SAAS,qBACd,WACS;AACT,QAAM,OACJ,OAAO,cAAc,WAAW,YAAY,UAAU,cAAc,IAAI;AAC1E,SAAO,oBAAoB;AAAA,IACzB,CAAC,kBAAkB,cAAc,cAAc,IAAI,MAAM;AAAA,EAC3D;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,41 @@
1
+ import { GraphQLLeafType } from "graphql";
2
+ import { DirectiveDefinitionTuple, SchemaFragmentDefinitions, EnumTypeDefinitionTuple, FieldDefinition, FieldDefinitionRecord, InputObjectTypeDefinitionTuple, InputValueDefinition, InputValueDefinitionRecord, InterfaceTypeDefinitionTuple, ObjectTypeDefinitionTuple, ScalarTypeDefinitionTuple, TypeName, TypeReference, UnionTypeDefinitionTuple } from "./definition";
3
+ import { FunctionFieldResolver, TypeResolver, UserResolvers } from "../types";
4
+ export declare class SchemaFragment {
5
+ private definitions;
6
+ private resolvers;
7
+ static parseOptions: {
8
+ noLocation: boolean;
9
+ };
10
+ private static scalarTypeResolvers;
11
+ private static enumTypeResolvers;
12
+ constructor(definitions: SchemaFragmentDefinitions, resolvers: UserResolvers);
13
+ getTypeReference(tupleOrRef: FieldDefinition | InputValueDefinition): TypeReference;
14
+ getObjectType(typeName: TypeName): ObjectTypeDefinitionTuple | undefined;
15
+ getObjectFields(def: ObjectTypeDefinitionTuple): FieldDefinitionRecord | undefined;
16
+ addInterfaceImplementation(interfaceType: TypeName, objectType: TypeName): void;
17
+ getField(typeName: TypeName, fieldName: string): FieldDefinition | undefined;
18
+ private getOwnField;
19
+ private findInterfaceField;
20
+ private findField;
21
+ getFieldArguments(field: FieldDefinition): InputValueDefinitionRecord | undefined;
22
+ getDirectiveArguments(directive: DirectiveDefinitionTuple): InputValueDefinitionRecord | undefined;
23
+ resolveDefinitionArguments(def: FieldDefinition | DirectiveDefinitionTuple): InputValueDefinitionRecord | undefined;
24
+ getInputObjectType(typeRef: TypeReference): InputObjectTypeDefinitionTuple | undefined;
25
+ getInputObjectFields(obj: InputObjectTypeDefinitionTuple): InputValueDefinitionRecord;
26
+ getInputDefaultValue(inputValue: InputValueDefinition): unknown | undefined;
27
+ getLeafType(typeRef: TypeReference): EnumTypeDefinitionTuple | ScalarTypeDefinitionTuple | undefined;
28
+ isDefined(typeRef: TypeReference): boolean;
29
+ isInputType(typeRef: TypeReference): boolean;
30
+ isObjectType(typeRef: TypeReference): boolean;
31
+ isAbstractType(typeRef: TypeReference): boolean;
32
+ getUnionType(typeRef: TypeReference): UnionTypeDefinitionTuple | undefined;
33
+ getInterfaceType(typeRef: TypeReference): InterfaceTypeDefinitionTuple | undefined;
34
+ isSubType(abstractTypeName: TypeName, maybeSubTypeName: TypeName): boolean;
35
+ getFieldResolver(typeName: TypeName, fieldName: string): FunctionFieldResolver<unknown, unknown> | undefined;
36
+ getSubscriptionFieldResolver(subscriptionTypeName: TypeName, fieldName: string): FunctionFieldResolver<unknown, unknown> | undefined;
37
+ getAbstractTypeResolver(typeName: TypeName): TypeResolver<unknown, unknown> | undefined;
38
+ getLeafTypeResolver(typeRef: TypeReference): GraphQLLeafType | undefined;
39
+ getDirectiveName(def: DirectiveDefinitionTuple): string;
40
+ }
41
+ //# sourceMappingURL=fragment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fragment.d.ts","sourceRoot":"","sources":["../../src/schema/fragment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,eAAe,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,EACL,wBAAwB,EAExB,yBAAyB,EAEzB,uBAAuB,EACvB,eAAe,EACf,qBAAqB,EAGrB,8BAA8B,EAC9B,oBAAoB,EACpB,0BAA0B,EAG1B,4BAA4B,EAE5B,yBAAyB,EACzB,yBAAyB,EAEzB,QAAQ,EACR,aAAa,EAEb,wBAAwB,EACzB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,qBAAqB,EAGrB,YAAY,EACZ,aAAa,EACd,MAAM,UAAU,CAAC;AAelB,qBAAa,cAAc;IAWvB,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,SAAS;IAXnB,MAAM,CAAC,YAAY;;MAAwB;IAE3C,OAAO,CAAC,MAAM,CAAC,mBAAmB,CACZ;IAEtB,OAAO,CAAC,MAAM,CAAC,iBAAiB,CACV;gBAIZ,WAAW,EAAE,yBAAyB,EACtC,SAAS,EAAE,aAAa;IAG3B,gBAAgB,CACrB,UAAU,EAAE,eAAe,GAAG,oBAAoB,GACjD,aAAa;IAIT,aAAa,CAClB,QAAQ,EAAE,QAAQ,GACjB,yBAAyB,GAAG,SAAS;IAKjC,eAAe,CACpB,GAAG,EAAE,yBAAyB,GAC7B,qBAAqB,GAAG,SAAS;IAI7B,0BAA0B,CAC/B,aAAa,EAAE,QAAQ,EACvB,UAAU,EAAE,QAAQ;IA4Bf,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM;IAUrD,OAAO,CAAC,WAAW;IAiBnB,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,SAAS;IAYV,iBAAiB,CACtB,KAAK,EAAE,eAAe,GACrB,0BAA0B,GAAG,SAAS;IAIlC,qBAAqB,CAC1B,SAAS,EAAE,wBAAwB,GAClC,0BAA0B,GAAG,SAAS;IAIlC,0BAA0B,CAC/B,GAAG,EAAE,eAAe,GAAG,wBAAwB,GAC9C,0BAA0B,GAAG,SAAS;IAKlC,kBAAkB,CACvB,OAAO,EAAE,aAAa,GACrB,8BAA8B,GAAG,SAAS;IAKtC,oBAAoB,CACzB,GAAG,EAAE,8BAA8B,GAClC,0BAA0B;IAItB,oBAAoB,CACzB,UAAU,EAAE,oBAAoB,GAC/B,OAAO,GAAG,SAAS;IAMf,WAAW,CAChB,OAAO,EAAE,aAAa,GACrB,uBAAuB,GAAG,yBAAyB,GAAG,SAAS;IAa3D,SAAS,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO;IAU1C,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO;IAY5C,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO;IAU7C,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO;IAU/C,YAAY,CACjB,OAAO,EAAE,aAAa,GACrB,wBAAwB,GAAG,SAAS;IAMhC,gBAAgB,CACrB,OAAO,EAAE,aAAa,GACrB,4BAA4B,GAAG,SAAS;IAMpC,SAAS,CACd,gBAAgB,EAAE,QAAQ,EAC1B,gBAAgB,EAAE,QAAQ,GACzB,OAAO;IAgBH,gBAAgB,CACrB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,MAAM,GAChB,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,SAAS;IAW/C,4BAA4B,CACjC,oBAAoB,EAAE,QAAQ,EAC9B,SAAS,EAAE,MAAM,GAChB,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,SAAS;IAW/C,uBAAuB,CAC5B,QAAQ,EAAE,QAAQ,GACjB,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,SAAS;IAQtC,mBAAmB,CACxB,OAAO,EAAE,aAAa,GACrB,eAAe,GAAG,SAAS;IAoDvB,gBAAgB,CAAC,GAAG,EAAE,wBAAwB;CAGtD"}