@theguild/federation-composition 0.0.0-alpha-20230916192321-bb37b43
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.
- package/LICENSE +18 -0
- package/cjs/compose.js +85 -0
- package/cjs/graphql/helpers.js +32 -0
- package/cjs/graphql/printer.js +248 -0
- package/cjs/graphql/type-node-info.js +142 -0
- package/cjs/index.js +22 -0
- package/cjs/package.json +1 -0
- package/cjs/specifications/federation.js +211 -0
- package/cjs/specifications/inaccessible.js +10 -0
- package/cjs/specifications/join.js +35 -0
- package/cjs/specifications/link.js +222 -0
- package/cjs/specifications/tag.js +12 -0
- package/cjs/subgraph/helpers.js +255 -0
- package/cjs/subgraph/state.js +1154 -0
- package/cjs/subgraph/validation/rules/elements/compose-directive.js +41 -0
- package/cjs/subgraph/validation/rules/elements/extends.js +34 -0
- package/cjs/subgraph/validation/rules/elements/external.js +57 -0
- package/cjs/subgraph/validation/rules/elements/field-set.js +37 -0
- package/cjs/subgraph/validation/rules/elements/inaccessible.js +112 -0
- package/cjs/subgraph/validation/rules/elements/key.js +148 -0
- package/cjs/subgraph/validation/rules/elements/override.js +56 -0
- package/cjs/subgraph/validation/rules/elements/provides.js +173 -0
- package/cjs/subgraph/validation/rules/elements/requires.js +119 -0
- package/cjs/subgraph/validation/rules/elements/shareable.js +43 -0
- package/cjs/subgraph/validation/rules/elements/tag.js +120 -0
- package/cjs/subgraph/validation/rules/known-argument-names-on-directives-rule.js +34 -0
- package/cjs/subgraph/validation/rules/known-directives-rule.js +105 -0
- package/cjs/subgraph/validation/rules/known-federation-directive-rule.js +34 -0
- package/cjs/subgraph/validation/rules/known-root-type-rule.js +25 -0
- package/cjs/subgraph/validation/rules/known-type-names-rule.js +34 -0
- package/cjs/subgraph/validation/rules/lone-schema-definition-rule.js +20 -0
- package/cjs/subgraph/validation/rules/provided-arguments-on-directives-rule.js +104 -0
- package/cjs/subgraph/validation/rules/provided-required-arguments-on-directives-rule.js +46 -0
- package/cjs/subgraph/validation/rules/query-root-type-inaccessible-rule.js +33 -0
- package/cjs/subgraph/validation/rules/reserved-subgraph-name-rule.js +15 -0
- package/cjs/subgraph/validation/rules/root-type-used-rule.js +59 -0
- package/cjs/subgraph/validation/rules/unique-argument-definition-names-rule.js +42 -0
- package/cjs/subgraph/validation/rules/unique-argument-names-rule.js +27 -0
- package/cjs/subgraph/validation/rules/unique-directive-names-rule.js +24 -0
- package/cjs/subgraph/validation/rules/unique-directives-per-location-rule.js +52 -0
- package/cjs/subgraph/validation/rules/unique-enum-value-names-rule.js +33 -0
- package/cjs/subgraph/validation/rules/unique-field-definition-names-rule.js +37 -0
- package/cjs/subgraph/validation/rules/unique-input-field-names-rule.js +37 -0
- package/cjs/subgraph/validation/rules/unique-operation-types-rule.js +29 -0
- package/cjs/subgraph/validation/rules/unique-type-names-rule.js +29 -0
- package/cjs/subgraph/validation/validate-state.js +476 -0
- package/cjs/subgraph/validation/validate-subgraph.js +329 -0
- package/cjs/subgraph/validation/validation-context.js +267 -0
- package/cjs/supergraph/composition/ast.js +779 -0
- package/cjs/supergraph/composition/common.js +7 -0
- package/cjs/supergraph/composition/directive.js +93 -0
- package/cjs/supergraph/composition/enum-type.js +132 -0
- package/cjs/supergraph/composition/input-object-type.js +119 -0
- package/cjs/supergraph/composition/interface-type.js +226 -0
- package/cjs/supergraph/composition/object-type.js +380 -0
- package/cjs/supergraph/composition/scalar-type.js +63 -0
- package/cjs/supergraph/composition/union-type.js +64 -0
- package/cjs/supergraph/composition/visitor.js +62 -0
- package/cjs/supergraph/state.js +249 -0
- package/cjs/supergraph/validation/rules/default-value-uses-inaccessible-rule.js +35 -0
- package/cjs/supergraph/validation/rules/directive-composition-rule.js +98 -0
- package/cjs/supergraph/validation/rules/enum-values-rule.js +59 -0
- package/cjs/supergraph/validation/rules/extension-with-base.js +31 -0
- package/cjs/supergraph/validation/rules/external-argument-missing-rule.js +32 -0
- package/cjs/supergraph/validation/rules/external-missing-on-base-rule.js +48 -0
- package/cjs/supergraph/validation/rules/external-type-mismatch-rule.js +52 -0
- package/cjs/supergraph/validation/rules/field-argument-default-mismatch-rule.js +40 -0
- package/cjs/supergraph/validation/rules/field-arguments-of-the-same-type-rule.js +49 -0
- package/cjs/supergraph/validation/rules/fields-of-the-same-type-rule.js +89 -0
- package/cjs/supergraph/validation/rules/input-field-default-mismatch-rule.js +40 -0
- package/cjs/supergraph/validation/rules/input-object-values-rule.js +25 -0
- package/cjs/supergraph/validation/rules/interface-key-missing-implementation-type.js +46 -0
- package/cjs/supergraph/validation/rules/invalid-field-sharing-rule.js +45 -0
- package/cjs/supergraph/validation/rules/only-inaccessible-children-rule.js +40 -0
- package/cjs/supergraph/validation/rules/override-source-has-override.js +36 -0
- package/cjs/supergraph/validation/rules/referenced-inaccessible-rule.js +44 -0
- package/cjs/supergraph/validation/rules/required-argument-missing-in-some-subgraph-rule.js +32 -0
- package/cjs/supergraph/validation/rules/required-input-field-missing-in-some-subgraph-rule.js +32 -0
- package/cjs/supergraph/validation/rules/required-query-rule.js +14 -0
- package/cjs/supergraph/validation/rules/satisfiablity-rule.js +866 -0
- package/cjs/supergraph/validation/rules/subgraph-name-rule.js +18 -0
- package/cjs/supergraph/validation/rules/types-of-the-same-kind-rule.js +54 -0
- package/cjs/supergraph/validation/validate-supergraph.js +77 -0
- package/cjs/supergraph/validation/validation-context.js +25 -0
- package/cjs/types.js +0 -0
- package/cjs/utils/dependency-graph.js +227 -0
- package/cjs/utils/format.js +27 -0
- package/cjs/utils/helpers.js +7 -0
- package/cjs/utils/state.js +23 -0
- package/cjs/validate.js +117 -0
- package/esm/compose.js +78 -0
- package/esm/graphql/helpers.js +27 -0
- package/esm/graphql/printer.js +244 -0
- package/esm/graphql/type-node-info.js +137 -0
- package/esm/index.js +4 -0
- package/esm/specifications/federation.js +204 -0
- package/esm/specifications/inaccessible.js +7 -0
- package/esm/specifications/join.js +32 -0
- package/esm/specifications/link.js +210 -0
- package/esm/specifications/tag.js +9 -0
- package/esm/subgraph/helpers.js +245 -0
- package/esm/subgraph/state.js +1148 -0
- package/esm/subgraph/validation/rules/elements/compose-directive.js +37 -0
- package/esm/subgraph/validation/rules/elements/extends.js +30 -0
- package/esm/subgraph/validation/rules/elements/external.js +53 -0
- package/esm/subgraph/validation/rules/elements/field-set.js +33 -0
- package/esm/subgraph/validation/rules/elements/inaccessible.js +108 -0
- package/esm/subgraph/validation/rules/elements/key.js +144 -0
- package/esm/subgraph/validation/rules/elements/override.js +52 -0
- package/esm/subgraph/validation/rules/elements/provides.js +169 -0
- package/esm/subgraph/validation/rules/elements/requires.js +115 -0
- package/esm/subgraph/validation/rules/elements/shareable.js +39 -0
- package/esm/subgraph/validation/rules/elements/tag.js +116 -0
- package/esm/subgraph/validation/rules/known-argument-names-on-directives-rule.js +30 -0
- package/esm/subgraph/validation/rules/known-directives-rule.js +101 -0
- package/esm/subgraph/validation/rules/known-federation-directive-rule.js +30 -0
- package/esm/subgraph/validation/rules/known-root-type-rule.js +21 -0
- package/esm/subgraph/validation/rules/known-type-names-rule.js +30 -0
- package/esm/subgraph/validation/rules/lone-schema-definition-rule.js +16 -0
- package/esm/subgraph/validation/rules/provided-arguments-on-directives-rule.js +100 -0
- package/esm/subgraph/validation/rules/provided-required-arguments-on-directives-rule.js +42 -0
- package/esm/subgraph/validation/rules/query-root-type-inaccessible-rule.js +29 -0
- package/esm/subgraph/validation/rules/reserved-subgraph-name-rule.js +11 -0
- package/esm/subgraph/validation/rules/root-type-used-rule.js +55 -0
- package/esm/subgraph/validation/rules/unique-argument-definition-names-rule.js +38 -0
- package/esm/subgraph/validation/rules/unique-argument-names-rule.js +23 -0
- package/esm/subgraph/validation/rules/unique-directive-names-rule.js +20 -0
- package/esm/subgraph/validation/rules/unique-directives-per-location-rule.js +48 -0
- package/esm/subgraph/validation/rules/unique-enum-value-names-rule.js +29 -0
- package/esm/subgraph/validation/rules/unique-field-definition-names-rule.js +33 -0
- package/esm/subgraph/validation/rules/unique-input-field-names-rule.js +33 -0
- package/esm/subgraph/validation/rules/unique-operation-types-rule.js +25 -0
- package/esm/subgraph/validation/rules/unique-type-names-rule.js +25 -0
- package/esm/subgraph/validation/validate-state.js +463 -0
- package/esm/subgraph/validation/validate-subgraph.js +323 -0
- package/esm/subgraph/validation/validation-context.js +262 -0
- package/esm/supergraph/composition/ast.js +765 -0
- package/esm/supergraph/composition/common.js +3 -0
- package/esm/supergraph/composition/directive.js +89 -0
- package/esm/supergraph/composition/enum-type.js +128 -0
- package/esm/supergraph/composition/input-object-type.js +115 -0
- package/esm/supergraph/composition/interface-type.js +222 -0
- package/esm/supergraph/composition/object-type.js +375 -0
- package/esm/supergraph/composition/scalar-type.js +59 -0
- package/esm/supergraph/composition/union-type.js +60 -0
- package/esm/supergraph/composition/visitor.js +58 -0
- package/esm/supergraph/state.js +245 -0
- package/esm/supergraph/validation/rules/default-value-uses-inaccessible-rule.js +31 -0
- package/esm/supergraph/validation/rules/directive-composition-rule.js +94 -0
- package/esm/supergraph/validation/rules/enum-values-rule.js +55 -0
- package/esm/supergraph/validation/rules/extension-with-base.js +27 -0
- package/esm/supergraph/validation/rules/external-argument-missing-rule.js +28 -0
- package/esm/supergraph/validation/rules/external-missing-on-base-rule.js +44 -0
- package/esm/supergraph/validation/rules/external-type-mismatch-rule.js +48 -0
- package/esm/supergraph/validation/rules/field-argument-default-mismatch-rule.js +36 -0
- package/esm/supergraph/validation/rules/field-arguments-of-the-same-type-rule.js +45 -0
- package/esm/supergraph/validation/rules/fields-of-the-same-type-rule.js +85 -0
- package/esm/supergraph/validation/rules/input-field-default-mismatch-rule.js +36 -0
- package/esm/supergraph/validation/rules/input-object-values-rule.js +21 -0
- package/esm/supergraph/validation/rules/interface-key-missing-implementation-type.js +42 -0
- package/esm/supergraph/validation/rules/invalid-field-sharing-rule.js +41 -0
- package/esm/supergraph/validation/rules/only-inaccessible-children-rule.js +36 -0
- package/esm/supergraph/validation/rules/override-source-has-override.js +32 -0
- package/esm/supergraph/validation/rules/referenced-inaccessible-rule.js +40 -0
- package/esm/supergraph/validation/rules/required-argument-missing-in-some-subgraph-rule.js +28 -0
- package/esm/supergraph/validation/rules/required-input-field-missing-in-some-subgraph-rule.js +28 -0
- package/esm/supergraph/validation/rules/required-query-rule.js +10 -0
- package/esm/supergraph/validation/rules/satisfiablity-rule.js +862 -0
- package/esm/supergraph/validation/rules/subgraph-name-rule.js +14 -0
- package/esm/supergraph/validation/rules/types-of-the-same-kind-rule.js +50 -0
- package/esm/supergraph/validation/validate-supergraph.js +73 -0
- package/esm/supergraph/validation/validation-context.js +21 -0
- package/esm/types.js +0 -0
- package/esm/utils/dependency-graph.js +222 -0
- package/esm/utils/format.js +23 -0
- package/esm/utils/helpers.js +3 -0
- package/esm/utils/state.js +15 -0
- package/esm/validate.js +113 -0
- package/package.json +46 -0
- package/typings/compose.d.cts +16 -0
- package/typings/compose.d.ts +16 -0
- package/typings/graphql/helpers.d.cts +4 -0
- package/typings/graphql/helpers.d.ts +4 -0
- package/typings/graphql/printer.d.cts +3 -0
- package/typings/graphql/printer.d.ts +3 -0
- package/typings/graphql/type-node-info.d.cts +19 -0
- package/typings/graphql/type-node-info.d.ts +19 -0
- package/typings/index.d.cts +5 -0
- package/typings/index.d.ts +5 -0
- package/typings/specifications/federation.d.cts +45 -0
- package/typings/specifications/federation.d.ts +45 -0
- package/typings/specifications/inaccessible.d.cts +4 -0
- package/typings/specifications/inaccessible.d.ts +4 -0
- package/typings/specifications/join.d.cts +2 -0
- package/typings/specifications/join.d.ts +2 -0
- package/typings/specifications/link.d.cts +61 -0
- package/typings/specifications/link.d.ts +61 -0
- package/typings/specifications/tag.d.cts +4 -0
- package/typings/specifications/tag.d.ts +4 -0
- package/typings/subgraph/helpers.d.cts +44 -0
- package/typings/subgraph/helpers.d.ts +44 -0
- package/typings/subgraph/state.d.cts +322 -0
- package/typings/subgraph/state.d.ts +322 -0
- package/typings/subgraph/validation/rules/elements/compose-directive.d.cts +4 -0
- package/typings/subgraph/validation/rules/elements/compose-directive.d.ts +4 -0
- package/typings/subgraph/validation/rules/elements/extends.d.cts +4 -0
- package/typings/subgraph/validation/rules/elements/extends.d.ts +4 -0
- package/typings/subgraph/validation/rules/elements/external.d.cts +4 -0
- package/typings/subgraph/validation/rules/elements/external.d.ts +4 -0
- package/typings/subgraph/validation/rules/elements/field-set.d.cts +4 -0
- package/typings/subgraph/validation/rules/elements/field-set.d.ts +4 -0
- package/typings/subgraph/validation/rules/elements/inaccessible.d.cts +4 -0
- package/typings/subgraph/validation/rules/elements/inaccessible.d.ts +4 -0
- package/typings/subgraph/validation/rules/elements/key.d.cts +4 -0
- package/typings/subgraph/validation/rules/elements/key.d.ts +4 -0
- package/typings/subgraph/validation/rules/elements/override.d.cts +4 -0
- package/typings/subgraph/validation/rules/elements/override.d.ts +4 -0
- package/typings/subgraph/validation/rules/elements/provides.d.cts +4 -0
- package/typings/subgraph/validation/rules/elements/provides.d.ts +4 -0
- package/typings/subgraph/validation/rules/elements/requires.d.cts +4 -0
- package/typings/subgraph/validation/rules/elements/requires.d.ts +4 -0
- package/typings/subgraph/validation/rules/elements/shareable.d.cts +4 -0
- package/typings/subgraph/validation/rules/elements/shareable.d.ts +4 -0
- package/typings/subgraph/validation/rules/elements/tag.d.cts +4 -0
- package/typings/subgraph/validation/rules/elements/tag.d.ts +4 -0
- package/typings/subgraph/validation/rules/known-argument-names-on-directives-rule.d.cts +6 -0
- package/typings/subgraph/validation/rules/known-argument-names-on-directives-rule.d.ts +6 -0
- package/typings/subgraph/validation/rules/known-directives-rule.d.cts +6 -0
- package/typings/subgraph/validation/rules/known-directives-rule.d.ts +6 -0
- package/typings/subgraph/validation/rules/known-federation-directive-rule.d.cts +4 -0
- package/typings/subgraph/validation/rules/known-federation-directive-rule.d.ts +4 -0
- package/typings/subgraph/validation/rules/known-root-type-rule.d.cts +4 -0
- package/typings/subgraph/validation/rules/known-root-type-rule.d.ts +4 -0
- package/typings/subgraph/validation/rules/known-type-names-rule.d.cts +4 -0
- package/typings/subgraph/validation/rules/known-type-names-rule.d.ts +4 -0
- package/typings/subgraph/validation/rules/lone-schema-definition-rule.d.cts +5 -0
- package/typings/subgraph/validation/rules/lone-schema-definition-rule.d.ts +5 -0
- package/typings/subgraph/validation/rules/provided-arguments-on-directives-rule.d.cts +4 -0
- package/typings/subgraph/validation/rules/provided-arguments-on-directives-rule.d.ts +4 -0
- package/typings/subgraph/validation/rules/provided-required-arguments-on-directives-rule.d.cts +4 -0
- package/typings/subgraph/validation/rules/provided-required-arguments-on-directives-rule.d.ts +4 -0
- package/typings/subgraph/validation/rules/query-root-type-inaccessible-rule.d.cts +4 -0
- package/typings/subgraph/validation/rules/query-root-type-inaccessible-rule.d.ts +4 -0
- package/typings/subgraph/validation/rules/reserved-subgraph-name-rule.d.cts +4 -0
- package/typings/subgraph/validation/rules/reserved-subgraph-name-rule.d.ts +4 -0
- package/typings/subgraph/validation/rules/root-type-used-rule.d.cts +4 -0
- package/typings/subgraph/validation/rules/root-type-used-rule.d.ts +4 -0
- package/typings/subgraph/validation/rules/unique-argument-definition-names-rule.d.cts +5 -0
- package/typings/subgraph/validation/rules/unique-argument-definition-names-rule.d.ts +5 -0
- package/typings/subgraph/validation/rules/unique-argument-names-rule.d.cts +5 -0
- package/typings/subgraph/validation/rules/unique-argument-names-rule.d.ts +5 -0
- package/typings/subgraph/validation/rules/unique-directive-names-rule.d.cts +5 -0
- package/typings/subgraph/validation/rules/unique-directive-names-rule.d.ts +5 -0
- package/typings/subgraph/validation/rules/unique-directives-per-location-rule.d.cts +6 -0
- package/typings/subgraph/validation/rules/unique-directives-per-location-rule.d.ts +6 -0
- package/typings/subgraph/validation/rules/unique-enum-value-names-rule.d.cts +5 -0
- package/typings/subgraph/validation/rules/unique-enum-value-names-rule.d.ts +5 -0
- package/typings/subgraph/validation/rules/unique-field-definition-names-rule.d.cts +5 -0
- package/typings/subgraph/validation/rules/unique-field-definition-names-rule.d.ts +5 -0
- package/typings/subgraph/validation/rules/unique-input-field-names-rule.d.cts +5 -0
- package/typings/subgraph/validation/rules/unique-input-field-names-rule.d.ts +5 -0
- package/typings/subgraph/validation/rules/unique-operation-types-rule.d.cts +5 -0
- package/typings/subgraph/validation/rules/unique-operation-types-rule.d.ts +5 -0
- package/typings/subgraph/validation/rules/unique-type-names-rule.d.cts +5 -0
- package/typings/subgraph/validation/rules/unique-type-names-rule.d.ts +5 -0
- package/typings/subgraph/validation/validate-state.d.cts +13 -0
- package/typings/subgraph/validation/validate-state.d.ts +13 -0
- package/typings/subgraph/validation/validate-subgraph.d.cts +43 -0
- package/typings/subgraph/validation/validate-subgraph.d.ts +43 -0
- package/typings/subgraph/validation/validation-context.d.cts +182 -0
- package/typings/subgraph/validation/validation-context.d.ts +182 -0
- package/typings/supergraph/composition/ast.d.cts +216 -0
- package/typings/supergraph/composition/ast.d.ts +216 -0
- package/typings/supergraph/composition/common.d.cts +19 -0
- package/typings/supergraph/composition/common.d.ts +19 -0
- package/typings/supergraph/composition/directive.d.cts +32 -0
- package/typings/supergraph/composition/directive.d.ts +32 -0
- package/typings/supergraph/composition/enum-type.d.cts +32 -0
- package/typings/supergraph/composition/enum-type.d.ts +32 -0
- package/typings/supergraph/composition/input-object-type.d.cts +32 -0
- package/typings/supergraph/composition/input-object-type.d.ts +32 -0
- package/typings/supergraph/composition/interface-type.d.cts +61 -0
- package/typings/supergraph/composition/interface-type.d.ts +61 -0
- package/typings/supergraph/composition/object-type.d.cts +79 -0
- package/typings/supergraph/composition/object-type.d.ts +79 -0
- package/typings/supergraph/composition/scalar-type.d.cts +20 -0
- package/typings/supergraph/composition/scalar-type.d.ts +20 -0
- package/typings/supergraph/composition/union-type.d.cts +17 -0
- package/typings/supergraph/composition/union-type.d.ts +17 -0
- package/typings/supergraph/composition/visitor.d.cts +18 -0
- package/typings/supergraph/composition/visitor.d.ts +18 -0
- package/typings/supergraph/state.d.cts +51 -0
- package/typings/supergraph/state.d.ts +51 -0
- package/typings/supergraph/validation/rules/default-value-uses-inaccessible-rule.d.cts +5 -0
- package/typings/supergraph/validation/rules/default-value-uses-inaccessible-rule.d.ts +5 -0
- package/typings/supergraph/validation/rules/directive-composition-rule.d.cts +5 -0
- package/typings/supergraph/validation/rules/directive-composition-rule.d.ts +5 -0
- package/typings/supergraph/validation/rules/enum-values-rule.d.cts +4 -0
- package/typings/supergraph/validation/rules/enum-values-rule.d.ts +4 -0
- package/typings/supergraph/validation/rules/extension-with-base.d.cts +4 -0
- package/typings/supergraph/validation/rules/extension-with-base.d.ts +4 -0
- package/typings/supergraph/validation/rules/external-argument-missing-rule.d.cts +4 -0
- package/typings/supergraph/validation/rules/external-argument-missing-rule.d.ts +4 -0
- package/typings/supergraph/validation/rules/external-missing-on-base-rule.d.cts +4 -0
- package/typings/supergraph/validation/rules/external-missing-on-base-rule.d.ts +4 -0
- package/typings/supergraph/validation/rules/external-type-mismatch-rule.d.cts +4 -0
- package/typings/supergraph/validation/rules/external-type-mismatch-rule.d.ts +4 -0
- package/typings/supergraph/validation/rules/field-argument-default-mismatch-rule.d.cts +4 -0
- package/typings/supergraph/validation/rules/field-argument-default-mismatch-rule.d.ts +4 -0
- package/typings/supergraph/validation/rules/field-arguments-of-the-same-type-rule.d.cts +4 -0
- package/typings/supergraph/validation/rules/field-arguments-of-the-same-type-rule.d.ts +4 -0
- package/typings/supergraph/validation/rules/fields-of-the-same-type-rule.d.cts +4 -0
- package/typings/supergraph/validation/rules/fields-of-the-same-type-rule.d.ts +4 -0
- package/typings/supergraph/validation/rules/input-field-default-mismatch-rule.d.cts +4 -0
- package/typings/supergraph/validation/rules/input-field-default-mismatch-rule.d.ts +4 -0
- package/typings/supergraph/validation/rules/input-object-values-rule.d.cts +4 -0
- package/typings/supergraph/validation/rules/input-object-values-rule.d.ts +4 -0
- package/typings/supergraph/validation/rules/interface-key-missing-implementation-type.d.cts +4 -0
- package/typings/supergraph/validation/rules/interface-key-missing-implementation-type.d.ts +4 -0
- package/typings/supergraph/validation/rules/invalid-field-sharing-rule.d.cts +4 -0
- package/typings/supergraph/validation/rules/invalid-field-sharing-rule.d.ts +4 -0
- package/typings/supergraph/validation/rules/only-inaccessible-children-rule.d.cts +4 -0
- package/typings/supergraph/validation/rules/only-inaccessible-children-rule.d.ts +4 -0
- package/typings/supergraph/validation/rules/override-source-has-override.d.cts +4 -0
- package/typings/supergraph/validation/rules/override-source-has-override.d.ts +4 -0
- package/typings/supergraph/validation/rules/referenced-inaccessible-rule.d.cts +5 -0
- package/typings/supergraph/validation/rules/referenced-inaccessible-rule.d.ts +5 -0
- package/typings/supergraph/validation/rules/required-argument-missing-in-some-subgraph-rule.d.cts +4 -0
- package/typings/supergraph/validation/rules/required-argument-missing-in-some-subgraph-rule.d.ts +4 -0
- package/typings/supergraph/validation/rules/required-input-field-missing-in-some-subgraph-rule.d.cts +4 -0
- package/typings/supergraph/validation/rules/required-input-field-missing-in-some-subgraph-rule.d.ts +4 -0
- package/typings/supergraph/validation/rules/required-query-rule.d.cts +3 -0
- package/typings/supergraph/validation/rules/required-query-rule.d.ts +3 -0
- package/typings/supergraph/validation/rules/satisfiablity-rule.d.cts +5 -0
- package/typings/supergraph/validation/rules/satisfiablity-rule.d.ts +5 -0
- package/typings/supergraph/validation/rules/subgraph-name-rule.d.cts +3 -0
- package/typings/supergraph/validation/rules/subgraph-name-rule.d.ts +3 -0
- package/typings/supergraph/validation/rules/types-of-the-same-kind-rule.d.cts +3 -0
- package/typings/supergraph/validation/rules/types-of-the-same-kind-rule.d.ts +3 -0
- package/typings/supergraph/validation/validate-supergraph.d.cts +6 -0
- package/typings/supergraph/validation/validate-supergraph.d.ts +6 -0
- package/typings/supergraph/validation/validation-context.d.cts +10 -0
- package/typings/supergraph/validation/validation-context.d.ts +10 -0
- package/typings/types.d.cts +7 -0
- package/typings/types.d.ts +7 -0
- package/typings/utils/dependency-graph.d.cts +31 -0
- package/typings/utils/dependency-graph.d.ts +31 -0
- package/typings/utils/format.d.cts +2 -0
- package/typings/utils/format.d.ts +2 -0
- package/typings/utils/helpers.d.cts +2 -0
- package/typings/utils/helpers.d.ts +2 -0
- package/typings/utils/state.d.cts +6 -0
- package/typings/utils/state.d.ts +6 -0
- package/typings/validate.d.cts +37 -0
- package/typings/validate.d.ts +37 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { ASTNode, DirectiveDefinitionNode, DocumentNode, GraphQLError, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, Kind, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, TypeDefinitionNode, TypeExtensionNode } from 'graphql';
|
|
2
|
+
import { TypeNodeInfo } from '../../graphql/type-node-info.cjs';
|
|
3
|
+
import { FederationVersion } from '../../specifications/federation.cjs';
|
|
4
|
+
import { LinkImport } from '../../specifications/link.cjs';
|
|
5
|
+
import { type SubgraphStateBuilder } from '../state.cjs';
|
|
6
|
+
export type SubgraphValidationContext = ReturnType<typeof createSubgraphValidationContext>;
|
|
7
|
+
export type SimpleValidationContext = ReturnType<typeof createSimpleValidationContext>;
|
|
8
|
+
export declare function createSimpleValidationContext(typeDefs: DocumentNode, typeNodeInfo: TypeNodeInfo): {
|
|
9
|
+
getDocument(): DocumentNode;
|
|
10
|
+
getKnownDirectiveDefinition(name: string): DirectiveDefinitionNode | undefined;
|
|
11
|
+
getKnownTypeDefinition(name: string): Pick<TypeDefinitionNode | TypeExtensionNode, "name" | "kind"> | undefined;
|
|
12
|
+
getSchemaCoordinate(ancestors: readonly (ASTNode | readonly ASTNode[])[]): string;
|
|
13
|
+
reportError(error: GraphQLError): void;
|
|
14
|
+
collectReportedErrors(): GraphQLError[];
|
|
15
|
+
};
|
|
16
|
+
export declare function createSubgraphValidationContext(subgraph: {
|
|
17
|
+
name: string;
|
|
18
|
+
id: string;
|
|
19
|
+
typeDefs: DocumentNode;
|
|
20
|
+
}, federation: {
|
|
21
|
+
version: FederationVersion;
|
|
22
|
+
imports: readonly LinkImport[];
|
|
23
|
+
}, typeNodeInfo: TypeNodeInfo, stateBuilder: SubgraphStateBuilder): {
|
|
24
|
+
stateBuilder: {
|
|
25
|
+
directive: {
|
|
26
|
+
setComposed(directiveName: string): void;
|
|
27
|
+
setLocation(directiveName: string, location: string): void;
|
|
28
|
+
setRepeatable(directiveName: string): void;
|
|
29
|
+
arg: {
|
|
30
|
+
setTag(directiveName: string, argName: string, tag: string): void;
|
|
31
|
+
setType(directiveName: string, argName: string, argType: string): void;
|
|
32
|
+
setDirective(typeName: string, argName: string, directive: import("graphql").DirectiveNode): void;
|
|
33
|
+
setDefaultValue(typeName: string, argName: string, defaultValue: string): void;
|
|
34
|
+
setInaccessible(typeName: string, argName: string): void;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
scalarType: {
|
|
38
|
+
setDefinition(typeName: string): void;
|
|
39
|
+
setInaccessible(typeName: string): void;
|
|
40
|
+
setTag(typeName: string, tag: string): void;
|
|
41
|
+
setDirective(typeName: string, directive: import("graphql").DirectiveNode): void;
|
|
42
|
+
setDescription(typeName: string, description: import("../state.js").Description): void;
|
|
43
|
+
setSpecifiedBy(typeName: string, url: string): void;
|
|
44
|
+
};
|
|
45
|
+
objectType: {
|
|
46
|
+
setDefinition(typeName: string): void;
|
|
47
|
+
setExtension(typeName: string, extensionType: "@extends" | "extend"): void;
|
|
48
|
+
setDescription(typeName: string, description: import("../state.js").Description): void;
|
|
49
|
+
setExternal(typeName: string): void;
|
|
50
|
+
setInterface(typeName: string, interfaceName: string): void;
|
|
51
|
+
setKey(typeName: string, fields: string, fieldsUsedInKey: Set<string>, resolvable: boolean): void;
|
|
52
|
+
setInaccessible(typeName: string): void;
|
|
53
|
+
setShareable(typeName: string): void;
|
|
54
|
+
setTag(typeName: string, tag: string): void;
|
|
55
|
+
setDirective(typeName: string, directive: import("graphql").DirectiveNode): void;
|
|
56
|
+
field: {
|
|
57
|
+
setType(typeName: string, fieldName: string, fieldType: string): void;
|
|
58
|
+
setDirective(typeName: string, fieldName: string, directive: import("graphql").DirectiveNode): void;
|
|
59
|
+
setDescription(typeName: string, fieldName: string, description: import("../state.js").Description): void;
|
|
60
|
+
setDeprecated(typeName: string, fieldName: string, reason?: string | undefined): void;
|
|
61
|
+
setExternal(typeName: string, fieldName: string): void;
|
|
62
|
+
setInaccessible(typeName: string, fieldName: string): void;
|
|
63
|
+
setOverride(typeName: string, fieldName: string, override: string): void;
|
|
64
|
+
setProvides(typeName: string, fieldName: string, provides: string): void;
|
|
65
|
+
setRequires(typeName: string, fieldName: string, requires: string): void;
|
|
66
|
+
markAsProvided(typeName: string, fieldName: string): void;
|
|
67
|
+
markedAsRequired(typeName: string, fieldName: string): void;
|
|
68
|
+
setShareable(typeName: string, fieldName: string): void;
|
|
69
|
+
setTag(typeName: string, fieldName: string, tag: string): void;
|
|
70
|
+
setUsed(typeName: string, fieldName: string): void;
|
|
71
|
+
arg: {
|
|
72
|
+
setType(typeName: string, fieldName: string, argName: string, argType: string): void;
|
|
73
|
+
setDescription(typeName: string, fieldName: string, argName: string, description: import("../state.js").Description): void;
|
|
74
|
+
setDeprecated(typeName: string, fieldName: string, argName: string, reason?: string | undefined): void;
|
|
75
|
+
setDirective(typeName: string, fieldName: string, argName: string, directive: import("graphql").DirectiveNode): void;
|
|
76
|
+
setDefaultValue(typeName: string, fieldName: string, argName: string, defaultValue: string): void;
|
|
77
|
+
setInaccessible(typeName: string, fieldName: string, argName: string): void;
|
|
78
|
+
setTag(typeName: string, fieldName: string, argName: string, tag: string): void;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
interfaceType: {
|
|
83
|
+
setDefinition(typeName: string): void;
|
|
84
|
+
setExtension(typeName: string): void;
|
|
85
|
+
setInterface(typeName: string, interfaceName: string): void;
|
|
86
|
+
setKey(typeName: string, fields: string, fieldsUsedInKey: Set<string>, resolvable: boolean): void;
|
|
87
|
+
setInaccessible(typeName: string): void;
|
|
88
|
+
setTag(typeName: string, tag: string): void;
|
|
89
|
+
setDirective(typeName: string, directive: import("graphql").DirectiveNode): void;
|
|
90
|
+
setDescription(typeName: string, description: import("../state.js").Description): void;
|
|
91
|
+
field: {
|
|
92
|
+
setType(typeName: string, fieldName: string, fieldType: string): void;
|
|
93
|
+
setExternal(typeName: string, fieldName: string): void;
|
|
94
|
+
setInaccessible(typeName: string, fieldName: string): void;
|
|
95
|
+
setOverride(typeName: string, fieldName: string, override: string): void;
|
|
96
|
+
setRequires(typeName: string, fieldName: string, requires: string): void;
|
|
97
|
+
setShareable(typeName: string, fieldName: string): void;
|
|
98
|
+
setTag(typeName: string, fieldName: string, tag: string): void;
|
|
99
|
+
setUsed(typeName: string, fieldName: string): void;
|
|
100
|
+
setDirective(typeName: string, fieldName: string, directive: import("graphql").DirectiveNode): void;
|
|
101
|
+
setDescription(typeName: string, fieldName: string, description: import("../state.js").Description): void;
|
|
102
|
+
setDeprecated(typeName: string, fieldName: string, reason?: string | undefined): void;
|
|
103
|
+
arg: {
|
|
104
|
+
setType(typeName: string, fieldName: string, argName: string, argType: string): void;
|
|
105
|
+
setDefaultValue(typeName: string, fieldName: string, argName: string, defaultValue: string): void;
|
|
106
|
+
setDeprecated(typeName: string, fieldName: string, argName: string, reason?: string | undefined): void;
|
|
107
|
+
setDescription(typeName: string, fieldName: string, argName: string, description: import("../state.js").Description): void;
|
|
108
|
+
setTag(typeName: string, fieldName: string, argName: string, tag: string): void;
|
|
109
|
+
setInaccessible(typeName: string, fieldName: string, argName: string): void;
|
|
110
|
+
setDirective(typeName: string, fieldName: string, argName: string, directive: import("graphql").DirectiveNode): void;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
inputObjectType: {
|
|
115
|
+
setDefinition(typeName: string): void;
|
|
116
|
+
setExtension(typeName: string): void;
|
|
117
|
+
setDescription(typeName: string, description: import("../state.js").Description): void;
|
|
118
|
+
setInaccessible(typeName: string): void;
|
|
119
|
+
setTag(typeName: string, tag: string): void;
|
|
120
|
+
field: {
|
|
121
|
+
setType(typeName: string, fieldName: string, fieldType: string): void;
|
|
122
|
+
setDescription(typeName: string, fieldName: string, description: import("../state.js").Description): void;
|
|
123
|
+
setDeprecated(typeName: string, fieldName: string, reason?: string | undefined): void;
|
|
124
|
+
setDefaultValue(typeName: string, fieldName: string, defaultValue: string): void;
|
|
125
|
+
setInaccessible(typeName: string, fieldName: string): void;
|
|
126
|
+
setTag(typeName: string, fieldName: string, tag: string): void;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
unionType: {
|
|
130
|
+
setDefinition(typeName: string): void;
|
|
131
|
+
setInaccessible(typeName: string): void;
|
|
132
|
+
setTag(typeName: string, tag: string): void;
|
|
133
|
+
setDescription(typeName: string, description: import("../state.js").Description): void;
|
|
134
|
+
setMember(typeName: string, member: string): void;
|
|
135
|
+
};
|
|
136
|
+
enumType: {
|
|
137
|
+
setDefinition(typeName: string): void;
|
|
138
|
+
setInaccessible(typeName: string): void;
|
|
139
|
+
setDescription(typeName: string, description: import("../state.js").Description): void;
|
|
140
|
+
setTag(typeName: string, tag: string): void;
|
|
141
|
+
setReferencedByInputType(typeName: string, schemaCoordinate: string): void;
|
|
142
|
+
setReferencedByOutputType(typeName: string, schemaCoordinate: string): void;
|
|
143
|
+
value: {
|
|
144
|
+
setValue(typeName: string, valueName: string): void;
|
|
145
|
+
setDescription(typeName: string, valueName: string, description: import("../state.js").Description): void;
|
|
146
|
+
setInaccessible(typeName: string, valueName: string): void;
|
|
147
|
+
setTag(typeName: string, valueName: string, tag: string): void;
|
|
148
|
+
setDeprecated(typeName: string, valueName: string, reason?: string | undefined): void;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
composedDirectives: Set<string>;
|
|
152
|
+
state: import("../state.js").SubgraphState;
|
|
153
|
+
markSpecAsUsed(specName: "link" | "tag" | "inaccessible"): void;
|
|
154
|
+
visitor(typeNodeInfo: TypeNodeInfo): import("graphql").ASTVisitor;
|
|
155
|
+
};
|
|
156
|
+
isAvailableFederationType(name: string): boolean;
|
|
157
|
+
isAvailableFederationDirective(specDirectiveName: string, directiveNode: {
|
|
158
|
+
name: {
|
|
159
|
+
value: string;
|
|
160
|
+
} | string;
|
|
161
|
+
}): boolean;
|
|
162
|
+
satisfiesVersionRange(range: `${'<' | '>=' | '>'} ${FederationVersion}`): boolean;
|
|
163
|
+
getKnownFederationDirectives(): DirectiveDefinitionNode[];
|
|
164
|
+
getAvailableFederationDirectives(): DirectiveDefinitionNode[];
|
|
165
|
+
isLeafType(typeName: string): boolean;
|
|
166
|
+
getSubgraphObjectOrInterfaceTypes(): Map<string, ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode | ObjectTypeExtensionNode | InterfaceTypeExtensionNode>;
|
|
167
|
+
getSubgraphDirectiveDefinitions(): Map<string, DirectiveDefinitionNode>;
|
|
168
|
+
getAvailableFederationTypeAndDirectiveDefinitions(): (DirectiveDefinitionNode | TypeDefinitionNode)[];
|
|
169
|
+
typeNodeInfo: TypeNodeInfo;
|
|
170
|
+
getDocument(): DocumentNode;
|
|
171
|
+
getSubgraphName(): string;
|
|
172
|
+
getSubgraphId(): string;
|
|
173
|
+
markAsExternal(coordinate: string): void;
|
|
174
|
+
markAsUsed(reason: 'fields' | '@extends' | 'references @shareable', kind: Kind.OBJECT_TYPE_DEFINITION | Kind.INTERFACE_TYPE_DEFINITION | Kind.OBJECT_TYPE_EXTENSION | Kind.INTERFACE_TYPE_EXTENSION, typeName: string, fieldName: string): void;
|
|
175
|
+
markAsKeyField(coordinate: string): void;
|
|
176
|
+
markAsFederationDefinitionReplacement(name: string): void;
|
|
177
|
+
collectFederationDefinitionReplacements(): Set<string>;
|
|
178
|
+
collectUnusedExternal(): string[];
|
|
179
|
+
reportError(error: GraphQLError): void;
|
|
180
|
+
collectReportedErrors(): GraphQLError[];
|
|
181
|
+
};
|
|
182
|
+
//# sourceMappingURL=validation-context.d.ts.map
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { ASTNode, DirectiveDefinitionNode, DocumentNode, GraphQLError, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, Kind, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, TypeDefinitionNode, TypeExtensionNode } from 'graphql';
|
|
2
|
+
import { TypeNodeInfo } from '../../graphql/type-node-info.js';
|
|
3
|
+
import { FederationVersion } from '../../specifications/federation.js';
|
|
4
|
+
import { LinkImport } from '../../specifications/link.js';
|
|
5
|
+
import { type SubgraphStateBuilder } from '../state.js';
|
|
6
|
+
export type SubgraphValidationContext = ReturnType<typeof createSubgraphValidationContext>;
|
|
7
|
+
export type SimpleValidationContext = ReturnType<typeof createSimpleValidationContext>;
|
|
8
|
+
export declare function createSimpleValidationContext(typeDefs: DocumentNode, typeNodeInfo: TypeNodeInfo): {
|
|
9
|
+
getDocument(): DocumentNode;
|
|
10
|
+
getKnownDirectiveDefinition(name: string): DirectiveDefinitionNode | undefined;
|
|
11
|
+
getKnownTypeDefinition(name: string): Pick<TypeDefinitionNode | TypeExtensionNode, "name" | "kind"> | undefined;
|
|
12
|
+
getSchemaCoordinate(ancestors: readonly (ASTNode | readonly ASTNode[])[]): string;
|
|
13
|
+
reportError(error: GraphQLError): void;
|
|
14
|
+
collectReportedErrors(): GraphQLError[];
|
|
15
|
+
};
|
|
16
|
+
export declare function createSubgraphValidationContext(subgraph: {
|
|
17
|
+
name: string;
|
|
18
|
+
id: string;
|
|
19
|
+
typeDefs: DocumentNode;
|
|
20
|
+
}, federation: {
|
|
21
|
+
version: FederationVersion;
|
|
22
|
+
imports: readonly LinkImport[];
|
|
23
|
+
}, typeNodeInfo: TypeNodeInfo, stateBuilder: SubgraphStateBuilder): {
|
|
24
|
+
stateBuilder: {
|
|
25
|
+
directive: {
|
|
26
|
+
setComposed(directiveName: string): void;
|
|
27
|
+
setLocation(directiveName: string, location: string): void;
|
|
28
|
+
setRepeatable(directiveName: string): void;
|
|
29
|
+
arg: {
|
|
30
|
+
setTag(directiveName: string, argName: string, tag: string): void;
|
|
31
|
+
setType(directiveName: string, argName: string, argType: string): void;
|
|
32
|
+
setDirective(typeName: string, argName: string, directive: import("graphql").DirectiveNode): void;
|
|
33
|
+
setDefaultValue(typeName: string, argName: string, defaultValue: string): void;
|
|
34
|
+
setInaccessible(typeName: string, argName: string): void;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
scalarType: {
|
|
38
|
+
setDefinition(typeName: string): void;
|
|
39
|
+
setInaccessible(typeName: string): void;
|
|
40
|
+
setTag(typeName: string, tag: string): void;
|
|
41
|
+
setDirective(typeName: string, directive: import("graphql").DirectiveNode): void;
|
|
42
|
+
setDescription(typeName: string, description: import("../state.js").Description): void;
|
|
43
|
+
setSpecifiedBy(typeName: string, url: string): void;
|
|
44
|
+
};
|
|
45
|
+
objectType: {
|
|
46
|
+
setDefinition(typeName: string): void;
|
|
47
|
+
setExtension(typeName: string, extensionType: "@extends" | "extend"): void;
|
|
48
|
+
setDescription(typeName: string, description: import("../state.js").Description): void;
|
|
49
|
+
setExternal(typeName: string): void;
|
|
50
|
+
setInterface(typeName: string, interfaceName: string): void;
|
|
51
|
+
setKey(typeName: string, fields: string, fieldsUsedInKey: Set<string>, resolvable: boolean): void;
|
|
52
|
+
setInaccessible(typeName: string): void;
|
|
53
|
+
setShareable(typeName: string): void;
|
|
54
|
+
setTag(typeName: string, tag: string): void;
|
|
55
|
+
setDirective(typeName: string, directive: import("graphql").DirectiveNode): void;
|
|
56
|
+
field: {
|
|
57
|
+
setType(typeName: string, fieldName: string, fieldType: string): void;
|
|
58
|
+
setDirective(typeName: string, fieldName: string, directive: import("graphql").DirectiveNode): void;
|
|
59
|
+
setDescription(typeName: string, fieldName: string, description: import("../state.js").Description): void;
|
|
60
|
+
setDeprecated(typeName: string, fieldName: string, reason?: string | undefined): void;
|
|
61
|
+
setExternal(typeName: string, fieldName: string): void;
|
|
62
|
+
setInaccessible(typeName: string, fieldName: string): void;
|
|
63
|
+
setOverride(typeName: string, fieldName: string, override: string): void;
|
|
64
|
+
setProvides(typeName: string, fieldName: string, provides: string): void;
|
|
65
|
+
setRequires(typeName: string, fieldName: string, requires: string): void;
|
|
66
|
+
markAsProvided(typeName: string, fieldName: string): void;
|
|
67
|
+
markedAsRequired(typeName: string, fieldName: string): void;
|
|
68
|
+
setShareable(typeName: string, fieldName: string): void;
|
|
69
|
+
setTag(typeName: string, fieldName: string, tag: string): void;
|
|
70
|
+
setUsed(typeName: string, fieldName: string): void;
|
|
71
|
+
arg: {
|
|
72
|
+
setType(typeName: string, fieldName: string, argName: string, argType: string): void;
|
|
73
|
+
setDescription(typeName: string, fieldName: string, argName: string, description: import("../state.js").Description): void;
|
|
74
|
+
setDeprecated(typeName: string, fieldName: string, argName: string, reason?: string | undefined): void;
|
|
75
|
+
setDirective(typeName: string, fieldName: string, argName: string, directive: import("graphql").DirectiveNode): void;
|
|
76
|
+
setDefaultValue(typeName: string, fieldName: string, argName: string, defaultValue: string): void;
|
|
77
|
+
setInaccessible(typeName: string, fieldName: string, argName: string): void;
|
|
78
|
+
setTag(typeName: string, fieldName: string, argName: string, tag: string): void;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
interfaceType: {
|
|
83
|
+
setDefinition(typeName: string): void;
|
|
84
|
+
setExtension(typeName: string): void;
|
|
85
|
+
setInterface(typeName: string, interfaceName: string): void;
|
|
86
|
+
setKey(typeName: string, fields: string, fieldsUsedInKey: Set<string>, resolvable: boolean): void;
|
|
87
|
+
setInaccessible(typeName: string): void;
|
|
88
|
+
setTag(typeName: string, tag: string): void;
|
|
89
|
+
setDirective(typeName: string, directive: import("graphql").DirectiveNode): void;
|
|
90
|
+
setDescription(typeName: string, description: import("../state.js").Description): void;
|
|
91
|
+
field: {
|
|
92
|
+
setType(typeName: string, fieldName: string, fieldType: string): void;
|
|
93
|
+
setExternal(typeName: string, fieldName: string): void;
|
|
94
|
+
setInaccessible(typeName: string, fieldName: string): void;
|
|
95
|
+
setOverride(typeName: string, fieldName: string, override: string): void;
|
|
96
|
+
setRequires(typeName: string, fieldName: string, requires: string): void;
|
|
97
|
+
setShareable(typeName: string, fieldName: string): void;
|
|
98
|
+
setTag(typeName: string, fieldName: string, tag: string): void;
|
|
99
|
+
setUsed(typeName: string, fieldName: string): void;
|
|
100
|
+
setDirective(typeName: string, fieldName: string, directive: import("graphql").DirectiveNode): void;
|
|
101
|
+
setDescription(typeName: string, fieldName: string, description: import("../state.js").Description): void;
|
|
102
|
+
setDeprecated(typeName: string, fieldName: string, reason?: string | undefined): void;
|
|
103
|
+
arg: {
|
|
104
|
+
setType(typeName: string, fieldName: string, argName: string, argType: string): void;
|
|
105
|
+
setDefaultValue(typeName: string, fieldName: string, argName: string, defaultValue: string): void;
|
|
106
|
+
setDeprecated(typeName: string, fieldName: string, argName: string, reason?: string | undefined): void;
|
|
107
|
+
setDescription(typeName: string, fieldName: string, argName: string, description: import("../state.js").Description): void;
|
|
108
|
+
setTag(typeName: string, fieldName: string, argName: string, tag: string): void;
|
|
109
|
+
setInaccessible(typeName: string, fieldName: string, argName: string): void;
|
|
110
|
+
setDirective(typeName: string, fieldName: string, argName: string, directive: import("graphql").DirectiveNode): void;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
inputObjectType: {
|
|
115
|
+
setDefinition(typeName: string): void;
|
|
116
|
+
setExtension(typeName: string): void;
|
|
117
|
+
setDescription(typeName: string, description: import("../state.js").Description): void;
|
|
118
|
+
setInaccessible(typeName: string): void;
|
|
119
|
+
setTag(typeName: string, tag: string): void;
|
|
120
|
+
field: {
|
|
121
|
+
setType(typeName: string, fieldName: string, fieldType: string): void;
|
|
122
|
+
setDescription(typeName: string, fieldName: string, description: import("../state.js").Description): void;
|
|
123
|
+
setDeprecated(typeName: string, fieldName: string, reason?: string | undefined): void;
|
|
124
|
+
setDefaultValue(typeName: string, fieldName: string, defaultValue: string): void;
|
|
125
|
+
setInaccessible(typeName: string, fieldName: string): void;
|
|
126
|
+
setTag(typeName: string, fieldName: string, tag: string): void;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
unionType: {
|
|
130
|
+
setDefinition(typeName: string): void;
|
|
131
|
+
setInaccessible(typeName: string): void;
|
|
132
|
+
setTag(typeName: string, tag: string): void;
|
|
133
|
+
setDescription(typeName: string, description: import("../state.js").Description): void;
|
|
134
|
+
setMember(typeName: string, member: string): void;
|
|
135
|
+
};
|
|
136
|
+
enumType: {
|
|
137
|
+
setDefinition(typeName: string): void;
|
|
138
|
+
setInaccessible(typeName: string): void;
|
|
139
|
+
setDescription(typeName: string, description: import("../state.js").Description): void;
|
|
140
|
+
setTag(typeName: string, tag: string): void;
|
|
141
|
+
setReferencedByInputType(typeName: string, schemaCoordinate: string): void;
|
|
142
|
+
setReferencedByOutputType(typeName: string, schemaCoordinate: string): void;
|
|
143
|
+
value: {
|
|
144
|
+
setValue(typeName: string, valueName: string): void;
|
|
145
|
+
setDescription(typeName: string, valueName: string, description: import("../state.js").Description): void;
|
|
146
|
+
setInaccessible(typeName: string, valueName: string): void;
|
|
147
|
+
setTag(typeName: string, valueName: string, tag: string): void;
|
|
148
|
+
setDeprecated(typeName: string, valueName: string, reason?: string | undefined): void;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
composedDirectives: Set<string>;
|
|
152
|
+
state: import("../state.js").SubgraphState;
|
|
153
|
+
markSpecAsUsed(specName: "link" | "tag" | "inaccessible"): void;
|
|
154
|
+
visitor(typeNodeInfo: TypeNodeInfo): import("graphql").ASTVisitor;
|
|
155
|
+
};
|
|
156
|
+
isAvailableFederationType(name: string): boolean;
|
|
157
|
+
isAvailableFederationDirective(specDirectiveName: string, directiveNode: {
|
|
158
|
+
name: {
|
|
159
|
+
value: string;
|
|
160
|
+
} | string;
|
|
161
|
+
}): boolean;
|
|
162
|
+
satisfiesVersionRange(range: `${'<' | '>=' | '>'} ${FederationVersion}`): boolean;
|
|
163
|
+
getKnownFederationDirectives(): DirectiveDefinitionNode[];
|
|
164
|
+
getAvailableFederationDirectives(): DirectiveDefinitionNode[];
|
|
165
|
+
isLeafType(typeName: string): boolean;
|
|
166
|
+
getSubgraphObjectOrInterfaceTypes(): Map<string, ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode | ObjectTypeExtensionNode | InterfaceTypeExtensionNode>;
|
|
167
|
+
getSubgraphDirectiveDefinitions(): Map<string, DirectiveDefinitionNode>;
|
|
168
|
+
getAvailableFederationTypeAndDirectiveDefinitions(): (DirectiveDefinitionNode | TypeDefinitionNode)[];
|
|
169
|
+
typeNodeInfo: TypeNodeInfo;
|
|
170
|
+
getDocument(): DocumentNode;
|
|
171
|
+
getSubgraphName(): string;
|
|
172
|
+
getSubgraphId(): string;
|
|
173
|
+
markAsExternal(coordinate: string): void;
|
|
174
|
+
markAsUsed(reason: 'fields' | '@extends' | 'references @shareable', kind: Kind.OBJECT_TYPE_DEFINITION | Kind.INTERFACE_TYPE_DEFINITION | Kind.OBJECT_TYPE_EXTENSION | Kind.INTERFACE_TYPE_EXTENSION, typeName: string, fieldName: string): void;
|
|
175
|
+
markAsKeyField(coordinate: string): void;
|
|
176
|
+
markAsFederationDefinitionReplacement(name: string): void;
|
|
177
|
+
collectFederationDefinitionReplacements(): Set<string>;
|
|
178
|
+
collectUnusedExternal(): string[];
|
|
179
|
+
reportError(error: GraphQLError): void;
|
|
180
|
+
collectReportedErrors(): GraphQLError[];
|
|
181
|
+
};
|
|
182
|
+
//# sourceMappingURL=validation-context.d.ts.map
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { ASTNode, ConstDirectiveNode, DirectiveDefinitionNode, DocumentNode, EnumTypeDefinitionNode, EnumValueDefinitionNode, FieldDefinitionNode, InputObjectTypeDefinitionNode, InputValueDefinitionNode, InterfaceTypeDefinitionNode, ObjectTypeDefinitionNode, ScalarTypeDefinitionNode, SchemaDefinitionNode, StringValueNode, UnionTypeDefinitionNode } from 'graphql';
|
|
2
|
+
type inferArgument<T> = T extends (arg: infer A) => any ? A : never;
|
|
3
|
+
export type DirectiveAST = inferArgument<typeof createDirectiveNode>;
|
|
4
|
+
export type ObjectTypeAST = inferArgument<typeof createObjectTypeNode>;
|
|
5
|
+
export type FieldAST = inferArgument<typeof createFieldNode>;
|
|
6
|
+
export type FieldArgumentAST = inferArgument<typeof createFieldArgumentNode>;
|
|
7
|
+
export type InputFieldAST = inferArgument<typeof createInputFieldNode>;
|
|
8
|
+
export type EnumValueAST = inferArgument<typeof createEnumValueNode>;
|
|
9
|
+
export type JoinTypeAST = inferArgument<typeof createJoinTypeDirectiveNode>;
|
|
10
|
+
export type JoinImplementsAST = inferArgument<typeof createJoinImplementsDirectiveNode>;
|
|
11
|
+
export type JoinFieldAST = inferArgument<typeof createJoinFieldDirectiveNode>;
|
|
12
|
+
export type JoinUnionMemberAST = inferArgument<typeof createJoinUnionMemberDirectiveNode>;
|
|
13
|
+
export type JoinEnumValueAST = inferArgument<typeof createJoinEnumValueDirectiveNode>;
|
|
14
|
+
type Link = inferArgument<typeof createLinkDirectiveNode>;
|
|
15
|
+
type DescriptionAST = inferArgument<typeof createDescriptionNode>;
|
|
16
|
+
type Deprecated = {
|
|
17
|
+
reason?: string;
|
|
18
|
+
deprecated: true;
|
|
19
|
+
};
|
|
20
|
+
export declare function createSchemaNode(schema: {
|
|
21
|
+
query?: string;
|
|
22
|
+
mutation?: string;
|
|
23
|
+
subscription?: string;
|
|
24
|
+
links?: Link[];
|
|
25
|
+
}): SchemaDefinitionNode;
|
|
26
|
+
export declare function createDirectiveNode(directive: {
|
|
27
|
+
name: string;
|
|
28
|
+
tags?: string[];
|
|
29
|
+
arguments: FieldArgumentAST[];
|
|
30
|
+
locations: string[];
|
|
31
|
+
repeatable: boolean;
|
|
32
|
+
}): DirectiveDefinitionNode;
|
|
33
|
+
export declare function createObjectTypeNode(objectType: {
|
|
34
|
+
name: string;
|
|
35
|
+
fields: FieldAST[];
|
|
36
|
+
interfaces?: string[];
|
|
37
|
+
join?: {
|
|
38
|
+
type?: JoinTypeAST[];
|
|
39
|
+
implements?: JoinImplementsAST[];
|
|
40
|
+
};
|
|
41
|
+
tags?: string[];
|
|
42
|
+
inaccessible?: boolean;
|
|
43
|
+
description?: DescriptionAST;
|
|
44
|
+
ast?: {
|
|
45
|
+
directives?: ConstDirectiveNode[];
|
|
46
|
+
};
|
|
47
|
+
}): ObjectTypeDefinitionNode;
|
|
48
|
+
export declare function createInterfaceTypeNode(interfaceType: {
|
|
49
|
+
name: string;
|
|
50
|
+
fields: FieldAST[];
|
|
51
|
+
interfaces?: string[];
|
|
52
|
+
join?: {
|
|
53
|
+
type?: JoinTypeAST[];
|
|
54
|
+
implements?: JoinImplementsAST[];
|
|
55
|
+
};
|
|
56
|
+
tags?: string[];
|
|
57
|
+
inaccessible?: boolean;
|
|
58
|
+
description?: DescriptionAST;
|
|
59
|
+
ast?: {
|
|
60
|
+
directives?: ConstDirectiveNode[];
|
|
61
|
+
};
|
|
62
|
+
}): InterfaceTypeDefinitionNode;
|
|
63
|
+
export declare function createInputObjectTypeNode(inputObjectType: {
|
|
64
|
+
name: string;
|
|
65
|
+
fields: InputFieldAST[];
|
|
66
|
+
join?: {
|
|
67
|
+
type?: JoinTypeAST[];
|
|
68
|
+
};
|
|
69
|
+
tags?: string[];
|
|
70
|
+
inaccessible?: boolean;
|
|
71
|
+
description?: DescriptionAST;
|
|
72
|
+
ast?: {
|
|
73
|
+
directives?: ConstDirectiveNode[];
|
|
74
|
+
};
|
|
75
|
+
}): InputObjectTypeDefinitionNode;
|
|
76
|
+
export declare function createUnionTypeNode(unionType: {
|
|
77
|
+
name: string;
|
|
78
|
+
join?: {
|
|
79
|
+
type?: JoinTypeAST[];
|
|
80
|
+
unionMember?: JoinUnionMemberAST[];
|
|
81
|
+
};
|
|
82
|
+
members: string[];
|
|
83
|
+
inaccessible?: boolean;
|
|
84
|
+
description?: DescriptionAST;
|
|
85
|
+
tags?: string[];
|
|
86
|
+
ast?: {
|
|
87
|
+
directives?: ConstDirectiveNode[];
|
|
88
|
+
};
|
|
89
|
+
}): UnionTypeDefinitionNode;
|
|
90
|
+
export declare function createEnumTypeNode(enumType: {
|
|
91
|
+
name: string;
|
|
92
|
+
join?: {
|
|
93
|
+
type?: JoinTypeAST[];
|
|
94
|
+
};
|
|
95
|
+
tags?: string[];
|
|
96
|
+
inaccessible?: boolean;
|
|
97
|
+
description?: DescriptionAST;
|
|
98
|
+
values: EnumValueAST[];
|
|
99
|
+
ast?: {
|
|
100
|
+
directives?: ConstDirectiveNode[];
|
|
101
|
+
};
|
|
102
|
+
}): EnumTypeDefinitionNode;
|
|
103
|
+
export declare function createScalarTypeNode(scalarType: {
|
|
104
|
+
name: string;
|
|
105
|
+
join?: {
|
|
106
|
+
type?: JoinTypeAST[];
|
|
107
|
+
};
|
|
108
|
+
tags?: string[];
|
|
109
|
+
inaccessible?: boolean;
|
|
110
|
+
description?: DescriptionAST;
|
|
111
|
+
specifiedBy?: string;
|
|
112
|
+
ast?: {
|
|
113
|
+
directives?: ConstDirectiveNode[];
|
|
114
|
+
};
|
|
115
|
+
}): ScalarTypeDefinitionNode;
|
|
116
|
+
export declare function createJoinGraphEnumTypeNode(graphs: Array<{
|
|
117
|
+
name: string;
|
|
118
|
+
enumValue: string;
|
|
119
|
+
url?: string;
|
|
120
|
+
}>): EnumTypeDefinitionNode;
|
|
121
|
+
declare function createFieldNode(field: {
|
|
122
|
+
name: string;
|
|
123
|
+
type: string;
|
|
124
|
+
arguments?: FieldArgumentAST[];
|
|
125
|
+
join?: {
|
|
126
|
+
field?: JoinFieldAST[];
|
|
127
|
+
};
|
|
128
|
+
inaccessible?: boolean;
|
|
129
|
+
tags?: string[];
|
|
130
|
+
description?: DescriptionAST;
|
|
131
|
+
deprecated?: Deprecated;
|
|
132
|
+
ast?: {
|
|
133
|
+
directives?: ConstDirectiveNode[];
|
|
134
|
+
};
|
|
135
|
+
}): FieldDefinitionNode;
|
|
136
|
+
declare function createInputFieldNode(inputField: {
|
|
137
|
+
name: string;
|
|
138
|
+
type: string;
|
|
139
|
+
defaultValue?: string;
|
|
140
|
+
tags?: string[];
|
|
141
|
+
inaccessible?: boolean;
|
|
142
|
+
description?: DescriptionAST;
|
|
143
|
+
ast?: {
|
|
144
|
+
directives?: ConstDirectiveNode[];
|
|
145
|
+
};
|
|
146
|
+
join?: {
|
|
147
|
+
field?: JoinFieldAST[];
|
|
148
|
+
};
|
|
149
|
+
}): InputValueDefinitionNode;
|
|
150
|
+
declare function createEnumValueNode(enumValue: {
|
|
151
|
+
name: string;
|
|
152
|
+
join?: {
|
|
153
|
+
enumValue?: JoinEnumValueAST[];
|
|
154
|
+
};
|
|
155
|
+
tags?: string[];
|
|
156
|
+
inaccessible?: boolean;
|
|
157
|
+
description?: DescriptionAST;
|
|
158
|
+
deprecated?: Deprecated;
|
|
159
|
+
ast?: {
|
|
160
|
+
directives?: ConstDirectiveNode[];
|
|
161
|
+
};
|
|
162
|
+
}): EnumValueDefinitionNode;
|
|
163
|
+
declare function createFieldArgumentNode(argument: {
|
|
164
|
+
name: string;
|
|
165
|
+
type: string;
|
|
166
|
+
defaultValue?: string;
|
|
167
|
+
inaccessible?: boolean;
|
|
168
|
+
tags?: string[];
|
|
169
|
+
description?: DescriptionAST;
|
|
170
|
+
deprecated?: Deprecated;
|
|
171
|
+
ast?: {
|
|
172
|
+
directives?: ConstDirectiveNode[];
|
|
173
|
+
};
|
|
174
|
+
}): InputValueDefinitionNode;
|
|
175
|
+
declare function createJoinTypeDirectiveNode(join: {
|
|
176
|
+
graph: string;
|
|
177
|
+
key?: string;
|
|
178
|
+
isInterfaceObject?: boolean;
|
|
179
|
+
extension?: boolean;
|
|
180
|
+
resolvable?: boolean;
|
|
181
|
+
}): ConstDirectiveNode;
|
|
182
|
+
declare function createJoinImplementsDirectiveNode(join: {
|
|
183
|
+
graph: string;
|
|
184
|
+
interface: string;
|
|
185
|
+
}): ConstDirectiveNode;
|
|
186
|
+
declare function createJoinFieldDirectiveNode(join: {
|
|
187
|
+
graph?: string;
|
|
188
|
+
type?: string;
|
|
189
|
+
override?: string;
|
|
190
|
+
external?: boolean;
|
|
191
|
+
provides?: string;
|
|
192
|
+
requires?: string;
|
|
193
|
+
}): ConstDirectiveNode;
|
|
194
|
+
declare function createJoinUnionMemberDirectiveNode(join: {
|
|
195
|
+
graph: string;
|
|
196
|
+
member: string;
|
|
197
|
+
}): ConstDirectiveNode;
|
|
198
|
+
declare function createJoinEnumValueDirectiveNode(join: {
|
|
199
|
+
graph: string;
|
|
200
|
+
}): ConstDirectiveNode;
|
|
201
|
+
declare function createDescriptionNode(description: {
|
|
202
|
+
value: string;
|
|
203
|
+
block: boolean;
|
|
204
|
+
}): StringValueNode;
|
|
205
|
+
declare function createLinkDirectiveNode(link: {
|
|
206
|
+
url: string;
|
|
207
|
+
import?: Array<{
|
|
208
|
+
name: string;
|
|
209
|
+
alias?: string;
|
|
210
|
+
}>;
|
|
211
|
+
for?: string;
|
|
212
|
+
}): ConstDirectiveNode;
|
|
213
|
+
export declare function schemaCoordinate(paths: readonly (string | number)[], nodes: readonly (ASTNode | readonly ASTNode[])[]): string;
|
|
214
|
+
export declare function stripFederation(supergraph: DocumentNode): DocumentNode;
|
|
215
|
+
export {};
|
|
216
|
+
//# sourceMappingURL=ast.d.ts.map
|