@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,322 @@
|
|
|
1
|
+
import { ASTVisitor, DirectiveNode, DocumentNode } from 'graphql';
|
|
2
|
+
import { TypeNodeInfo } from '../graphql/type-node-info.cjs';
|
|
3
|
+
import { FederationVersion } from '../specifications/federation.cjs';
|
|
4
|
+
import { Link } from '../specifications/link.cjs';
|
|
5
|
+
export type SubgraphType = ObjectType | InterfaceType | InputObjectType | UnionType | EnumType | ScalarType | Directive;
|
|
6
|
+
export declare enum TypeKind {
|
|
7
|
+
OBJECT = "OBJECT",
|
|
8
|
+
INTERFACE = "INTERFACE",
|
|
9
|
+
ENUM = "ENUM",
|
|
10
|
+
UNION = "UNION",
|
|
11
|
+
SCALAR = "SCALAR",
|
|
12
|
+
INPUT_OBJECT = "INPUT_OBJECT",
|
|
13
|
+
DIRECTIVE = "DIRECTIVE"
|
|
14
|
+
}
|
|
15
|
+
export interface Directive {
|
|
16
|
+
kind: TypeKind.DIRECTIVE;
|
|
17
|
+
name: string;
|
|
18
|
+
composed: boolean;
|
|
19
|
+
repeatable: boolean;
|
|
20
|
+
locations: Set<string>;
|
|
21
|
+
args: Map<string, Argument>;
|
|
22
|
+
}
|
|
23
|
+
export interface ScalarType {
|
|
24
|
+
kind: TypeKind.SCALAR;
|
|
25
|
+
name: string;
|
|
26
|
+
inaccessible: boolean;
|
|
27
|
+
tags: Set<string>;
|
|
28
|
+
description?: Description;
|
|
29
|
+
specifiedBy?: string;
|
|
30
|
+
ast: {
|
|
31
|
+
directives: DirectiveNode[];
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export interface ObjectType {
|
|
35
|
+
kind: TypeKind.OBJECT;
|
|
36
|
+
name: string;
|
|
37
|
+
fields: Map<string, Field>;
|
|
38
|
+
extension: boolean;
|
|
39
|
+
extensionType?: '@extends' | 'extend';
|
|
40
|
+
external: boolean;
|
|
41
|
+
keys: Key[];
|
|
42
|
+
fieldsUsedAsKeys: Set<string>;
|
|
43
|
+
inaccessible: boolean;
|
|
44
|
+
shareable: boolean;
|
|
45
|
+
tags: Set<string>;
|
|
46
|
+
interfaces: Set<string>;
|
|
47
|
+
isDefinition: boolean;
|
|
48
|
+
description?: Description;
|
|
49
|
+
deprecated?: Deprecated;
|
|
50
|
+
ast: {
|
|
51
|
+
directives: DirectiveNode[];
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export interface InterfaceType {
|
|
55
|
+
kind: TypeKind.INTERFACE;
|
|
56
|
+
name: string;
|
|
57
|
+
fields: Map<string, Field>;
|
|
58
|
+
extension: boolean;
|
|
59
|
+
keys: Key[];
|
|
60
|
+
inaccessible: boolean;
|
|
61
|
+
tags: Set<string>;
|
|
62
|
+
interfaces: Set<string>;
|
|
63
|
+
isDefinition: boolean;
|
|
64
|
+
description?: Description;
|
|
65
|
+
implementedBy: Set<string>;
|
|
66
|
+
ast: {
|
|
67
|
+
directives: DirectiveNode[];
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export interface InputObjectType {
|
|
71
|
+
kind: TypeKind.INPUT_OBJECT;
|
|
72
|
+
name: string;
|
|
73
|
+
fields: Map<string, InputField>;
|
|
74
|
+
extension: boolean;
|
|
75
|
+
inaccessible: boolean;
|
|
76
|
+
tags: Set<string>;
|
|
77
|
+
isDefinition: boolean;
|
|
78
|
+
description?: Description;
|
|
79
|
+
}
|
|
80
|
+
export interface UnionType {
|
|
81
|
+
kind: TypeKind.UNION;
|
|
82
|
+
name: string;
|
|
83
|
+
members: Set<string>;
|
|
84
|
+
tags: Set<string>;
|
|
85
|
+
inaccessible: boolean;
|
|
86
|
+
isDefinition: boolean;
|
|
87
|
+
description?: Description;
|
|
88
|
+
}
|
|
89
|
+
export interface EnumType {
|
|
90
|
+
kind: TypeKind.ENUM;
|
|
91
|
+
name: string;
|
|
92
|
+
values: Map<string, EnumValue>;
|
|
93
|
+
inaccessible: boolean;
|
|
94
|
+
tags: Set<string>;
|
|
95
|
+
isDefinition: boolean;
|
|
96
|
+
description?: Description;
|
|
97
|
+
referencedByInputType: boolean;
|
|
98
|
+
referencedByOutputType: boolean;
|
|
99
|
+
inputTypeReferences: Set<string>;
|
|
100
|
+
outputTypeReferences: Set<string>;
|
|
101
|
+
}
|
|
102
|
+
export interface Field {
|
|
103
|
+
name: string;
|
|
104
|
+
type: string;
|
|
105
|
+
args: Map<string, Argument>;
|
|
106
|
+
external: boolean;
|
|
107
|
+
inaccessible: boolean;
|
|
108
|
+
override: string | null;
|
|
109
|
+
provides: string | null;
|
|
110
|
+
requires: string | null;
|
|
111
|
+
required: boolean;
|
|
112
|
+
provided: boolean;
|
|
113
|
+
shareable: boolean;
|
|
114
|
+
used: boolean;
|
|
115
|
+
tags: Set<string>;
|
|
116
|
+
description?: Description;
|
|
117
|
+
deprecated?: Deprecated;
|
|
118
|
+
ast: {
|
|
119
|
+
directives: DirectiveNode[];
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
export interface InputField {
|
|
123
|
+
name: string;
|
|
124
|
+
type: string;
|
|
125
|
+
inaccessible: boolean;
|
|
126
|
+
tags: Set<string>;
|
|
127
|
+
defaultValue?: string;
|
|
128
|
+
description?: Description;
|
|
129
|
+
deprecated?: Deprecated;
|
|
130
|
+
}
|
|
131
|
+
export interface EnumValue {
|
|
132
|
+
name: string;
|
|
133
|
+
inaccessible: boolean;
|
|
134
|
+
tags: Set<string>;
|
|
135
|
+
description?: Description;
|
|
136
|
+
deprecated?: Deprecated;
|
|
137
|
+
}
|
|
138
|
+
export interface Argument {
|
|
139
|
+
name: string;
|
|
140
|
+
type: string;
|
|
141
|
+
inaccessible: boolean;
|
|
142
|
+
tags: Set<string>;
|
|
143
|
+
defaultValue?: string;
|
|
144
|
+
description?: Description;
|
|
145
|
+
deprecated?: Deprecated;
|
|
146
|
+
ast: {
|
|
147
|
+
directives: DirectiveNode[];
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
export interface Key {
|
|
151
|
+
fields: string;
|
|
152
|
+
resolvable: boolean;
|
|
153
|
+
}
|
|
154
|
+
export interface Description {
|
|
155
|
+
value: string;
|
|
156
|
+
block: boolean;
|
|
157
|
+
}
|
|
158
|
+
export interface Deprecated {
|
|
159
|
+
reason?: string;
|
|
160
|
+
deprecated: true;
|
|
161
|
+
}
|
|
162
|
+
export interface SubgraphState {
|
|
163
|
+
graph: {
|
|
164
|
+
id: string;
|
|
165
|
+
name: string;
|
|
166
|
+
version: FederationVersion;
|
|
167
|
+
url?: string;
|
|
168
|
+
};
|
|
169
|
+
types: Map<string, SubgraphType>;
|
|
170
|
+
schema: {
|
|
171
|
+
queryType?: string;
|
|
172
|
+
mutationType?: string;
|
|
173
|
+
subscriptionType?: string;
|
|
174
|
+
};
|
|
175
|
+
links: readonly Link[];
|
|
176
|
+
specs: {
|
|
177
|
+
tag: boolean;
|
|
178
|
+
inaccessible: boolean;
|
|
179
|
+
link: boolean;
|
|
180
|
+
};
|
|
181
|
+
version: FederationVersion;
|
|
182
|
+
}
|
|
183
|
+
export type SubgraphStateBuilder = ReturnType<typeof createSubgraphStateBuilder>;
|
|
184
|
+
export declare function createSubgraphStateBuilder(graph: {
|
|
185
|
+
id: string;
|
|
186
|
+
name: string;
|
|
187
|
+
url?: string;
|
|
188
|
+
}, typeDefs: DocumentNode, version: FederationVersion, links: readonly Link[]): {
|
|
189
|
+
directive: {
|
|
190
|
+
setComposed(directiveName: string): void;
|
|
191
|
+
setLocation(directiveName: string, location: string): void;
|
|
192
|
+
setRepeatable(directiveName: string): void;
|
|
193
|
+
arg: {
|
|
194
|
+
setTag(directiveName: string, argName: string, tag: string): void;
|
|
195
|
+
setType(directiveName: string, argName: string, argType: string): void;
|
|
196
|
+
setDirective(typeName: string, argName: string, directive: DirectiveNode): void;
|
|
197
|
+
setDefaultValue(typeName: string, argName: string, defaultValue: string): void;
|
|
198
|
+
setInaccessible(typeName: string, argName: string): void;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
scalarType: {
|
|
202
|
+
setDefinition(typeName: string): void;
|
|
203
|
+
setInaccessible(typeName: string): void;
|
|
204
|
+
setTag(typeName: string, tag: string): void;
|
|
205
|
+
setDirective(typeName: string, directive: DirectiveNode): void;
|
|
206
|
+
setDescription(typeName: string, description: Description): void;
|
|
207
|
+
setSpecifiedBy(typeName: string, url: string): void;
|
|
208
|
+
};
|
|
209
|
+
objectType: {
|
|
210
|
+
setDefinition(typeName: string): void;
|
|
211
|
+
setExtension(typeName: string, extensionType: "@extends" | "extend"): void;
|
|
212
|
+
setDescription(typeName: string, description: Description): void;
|
|
213
|
+
setExternal(typeName: string): void;
|
|
214
|
+
setInterface(typeName: string, interfaceName: string): void;
|
|
215
|
+
setKey(typeName: string, fields: string, fieldsUsedInKey: Set<string>, resolvable: boolean): void;
|
|
216
|
+
setInaccessible(typeName: string): void;
|
|
217
|
+
setShareable(typeName: string): void;
|
|
218
|
+
setTag(typeName: string, tag: string): void;
|
|
219
|
+
setDirective(typeName: string, directive: DirectiveNode): void;
|
|
220
|
+
field: {
|
|
221
|
+
setType(typeName: string, fieldName: string, fieldType: string): void;
|
|
222
|
+
setDirective(typeName: string, fieldName: string, directive: DirectiveNode): void;
|
|
223
|
+
setDescription(typeName: string, fieldName: string, description: Description): void;
|
|
224
|
+
setDeprecated(typeName: string, fieldName: string, reason?: string | undefined): void;
|
|
225
|
+
setExternal(typeName: string, fieldName: string): void;
|
|
226
|
+
setInaccessible(typeName: string, fieldName: string): void;
|
|
227
|
+
setOverride(typeName: string, fieldName: string, override: string): void;
|
|
228
|
+
setProvides(typeName: string, fieldName: string, provides: string): void;
|
|
229
|
+
setRequires(typeName: string, fieldName: string, requires: string): void;
|
|
230
|
+
markAsProvided(typeName: string, fieldName: string): void;
|
|
231
|
+
markedAsRequired(typeName: string, fieldName: string): void;
|
|
232
|
+
setShareable(typeName: string, fieldName: string): void;
|
|
233
|
+
setTag(typeName: string, fieldName: string, tag: string): void;
|
|
234
|
+
setUsed(typeName: string, fieldName: string): void;
|
|
235
|
+
arg: {
|
|
236
|
+
setType(typeName: string, fieldName: string, argName: string, argType: string): void;
|
|
237
|
+
setDescription(typeName: string, fieldName: string, argName: string, description: Description): void;
|
|
238
|
+
setDeprecated(typeName: string, fieldName: string, argName: string, reason?: string | undefined): void;
|
|
239
|
+
setDirective(typeName: string, fieldName: string, argName: string, directive: DirectiveNode): void;
|
|
240
|
+
setDefaultValue(typeName: string, fieldName: string, argName: string, defaultValue: string): void;
|
|
241
|
+
setInaccessible(typeName: string, fieldName: string, argName: string): void;
|
|
242
|
+
setTag(typeName: string, fieldName: string, argName: string, tag: string): void;
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
interfaceType: {
|
|
247
|
+
setDefinition(typeName: string): void;
|
|
248
|
+
setExtension(typeName: string): void;
|
|
249
|
+
setInterface(typeName: string, interfaceName: string): void;
|
|
250
|
+
setKey(typeName: string, fields: string, fieldsUsedInKey: Set<string>, resolvable: boolean): void;
|
|
251
|
+
setInaccessible(typeName: string): void;
|
|
252
|
+
setTag(typeName: string, tag: string): void;
|
|
253
|
+
setDirective(typeName: string, directive: DirectiveNode): void;
|
|
254
|
+
setDescription(typeName: string, description: Description): void;
|
|
255
|
+
field: {
|
|
256
|
+
setType(typeName: string, fieldName: string, fieldType: string): void;
|
|
257
|
+
setExternal(typeName: string, fieldName: string): void;
|
|
258
|
+
setInaccessible(typeName: string, fieldName: string): void;
|
|
259
|
+
setOverride(typeName: string, fieldName: string, override: string): void;
|
|
260
|
+
setRequires(typeName: string, fieldName: string, requires: string): void;
|
|
261
|
+
setShareable(typeName: string, fieldName: string): void;
|
|
262
|
+
setTag(typeName: string, fieldName: string, tag: string): void;
|
|
263
|
+
setUsed(typeName: string, fieldName: string): void;
|
|
264
|
+
setDirective(typeName: string, fieldName: string, directive: DirectiveNode): void;
|
|
265
|
+
setDescription(typeName: string, fieldName: string, description: Description): void;
|
|
266
|
+
setDeprecated(typeName: string, fieldName: string, reason?: string | undefined): void;
|
|
267
|
+
arg: {
|
|
268
|
+
setType(typeName: string, fieldName: string, argName: string, argType: string): void;
|
|
269
|
+
setDefaultValue(typeName: string, fieldName: string, argName: string, defaultValue: string): void;
|
|
270
|
+
setDeprecated(typeName: string, fieldName: string, argName: string, reason?: string | undefined): void;
|
|
271
|
+
setDescription(typeName: string, fieldName: string, argName: string, description: Description): void;
|
|
272
|
+
setTag(typeName: string, fieldName: string, argName: string, tag: string): void;
|
|
273
|
+
setInaccessible(typeName: string, fieldName: string, argName: string): void;
|
|
274
|
+
setDirective(typeName: string, fieldName: string, argName: string, directive: DirectiveNode): void;
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
inputObjectType: {
|
|
279
|
+
setDefinition(typeName: string): void;
|
|
280
|
+
setExtension(typeName: string): void;
|
|
281
|
+
setDescription(typeName: string, description: Description): void;
|
|
282
|
+
setInaccessible(typeName: string): void;
|
|
283
|
+
setTag(typeName: string, tag: string): void;
|
|
284
|
+
field: {
|
|
285
|
+
setType(typeName: string, fieldName: string, fieldType: string): void;
|
|
286
|
+
setDescription(typeName: string, fieldName: string, description: Description): void;
|
|
287
|
+
setDeprecated(typeName: string, fieldName: string, reason?: string | undefined): void;
|
|
288
|
+
setDefaultValue(typeName: string, fieldName: string, defaultValue: string): void;
|
|
289
|
+
setInaccessible(typeName: string, fieldName: string): void;
|
|
290
|
+
setTag(typeName: string, fieldName: string, tag: string): void;
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
unionType: {
|
|
294
|
+
setDefinition(typeName: string): void;
|
|
295
|
+
setInaccessible(typeName: string): void;
|
|
296
|
+
setTag(typeName: string, tag: string): void;
|
|
297
|
+
setDescription(typeName: string, description: Description): void;
|
|
298
|
+
setMember(typeName: string, member: string): void;
|
|
299
|
+
};
|
|
300
|
+
enumType: {
|
|
301
|
+
setDefinition(typeName: string): void;
|
|
302
|
+
setInaccessible(typeName: string): void;
|
|
303
|
+
setDescription(typeName: string, description: Description): void;
|
|
304
|
+
setTag(typeName: string, tag: string): void;
|
|
305
|
+
setReferencedByInputType(typeName: string, schemaCoordinate: string): void;
|
|
306
|
+
setReferencedByOutputType(typeName: string, schemaCoordinate: string): void;
|
|
307
|
+
value: {
|
|
308
|
+
setValue(typeName: string, valueName: string): void;
|
|
309
|
+
setDescription(typeName: string, valueName: string, description: Description): void;
|
|
310
|
+
setInaccessible(typeName: string, valueName: string): void;
|
|
311
|
+
setTag(typeName: string, valueName: string, tag: string): void;
|
|
312
|
+
setDeprecated(typeName: string, valueName: string, reason?: string | undefined): void;
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
composedDirectives: Set<string>;
|
|
316
|
+
state: SubgraphState;
|
|
317
|
+
markSpecAsUsed(specName: keyof SubgraphState['specs']): void;
|
|
318
|
+
visitor(typeNodeInfo: TypeNodeInfo): ASTVisitor;
|
|
319
|
+
};
|
|
320
|
+
export declare function cleanSubgraphStateFromFederationSpec(state: SubgraphState): SubgraphState;
|
|
321
|
+
export declare function cleanSubgraphStateFromLinkSpec(state: SubgraphState): SubgraphState;
|
|
322
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { ASTVisitor, DirectiveNode, DocumentNode } from 'graphql';
|
|
2
|
+
import { TypeNodeInfo } from '../graphql/type-node-info.js';
|
|
3
|
+
import { FederationVersion } from '../specifications/federation.js';
|
|
4
|
+
import { Link } from '../specifications/link.js';
|
|
5
|
+
export type SubgraphType = ObjectType | InterfaceType | InputObjectType | UnionType | EnumType | ScalarType | Directive;
|
|
6
|
+
export declare enum TypeKind {
|
|
7
|
+
OBJECT = "OBJECT",
|
|
8
|
+
INTERFACE = "INTERFACE",
|
|
9
|
+
ENUM = "ENUM",
|
|
10
|
+
UNION = "UNION",
|
|
11
|
+
SCALAR = "SCALAR",
|
|
12
|
+
INPUT_OBJECT = "INPUT_OBJECT",
|
|
13
|
+
DIRECTIVE = "DIRECTIVE"
|
|
14
|
+
}
|
|
15
|
+
export interface Directive {
|
|
16
|
+
kind: TypeKind.DIRECTIVE;
|
|
17
|
+
name: string;
|
|
18
|
+
composed: boolean;
|
|
19
|
+
repeatable: boolean;
|
|
20
|
+
locations: Set<string>;
|
|
21
|
+
args: Map<string, Argument>;
|
|
22
|
+
}
|
|
23
|
+
export interface ScalarType {
|
|
24
|
+
kind: TypeKind.SCALAR;
|
|
25
|
+
name: string;
|
|
26
|
+
inaccessible: boolean;
|
|
27
|
+
tags: Set<string>;
|
|
28
|
+
description?: Description;
|
|
29
|
+
specifiedBy?: string;
|
|
30
|
+
ast: {
|
|
31
|
+
directives: DirectiveNode[];
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export interface ObjectType {
|
|
35
|
+
kind: TypeKind.OBJECT;
|
|
36
|
+
name: string;
|
|
37
|
+
fields: Map<string, Field>;
|
|
38
|
+
extension: boolean;
|
|
39
|
+
extensionType?: '@extends' | 'extend';
|
|
40
|
+
external: boolean;
|
|
41
|
+
keys: Key[];
|
|
42
|
+
fieldsUsedAsKeys: Set<string>;
|
|
43
|
+
inaccessible: boolean;
|
|
44
|
+
shareable: boolean;
|
|
45
|
+
tags: Set<string>;
|
|
46
|
+
interfaces: Set<string>;
|
|
47
|
+
isDefinition: boolean;
|
|
48
|
+
description?: Description;
|
|
49
|
+
deprecated?: Deprecated;
|
|
50
|
+
ast: {
|
|
51
|
+
directives: DirectiveNode[];
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export interface InterfaceType {
|
|
55
|
+
kind: TypeKind.INTERFACE;
|
|
56
|
+
name: string;
|
|
57
|
+
fields: Map<string, Field>;
|
|
58
|
+
extension: boolean;
|
|
59
|
+
keys: Key[];
|
|
60
|
+
inaccessible: boolean;
|
|
61
|
+
tags: Set<string>;
|
|
62
|
+
interfaces: Set<string>;
|
|
63
|
+
isDefinition: boolean;
|
|
64
|
+
description?: Description;
|
|
65
|
+
implementedBy: Set<string>;
|
|
66
|
+
ast: {
|
|
67
|
+
directives: DirectiveNode[];
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export interface InputObjectType {
|
|
71
|
+
kind: TypeKind.INPUT_OBJECT;
|
|
72
|
+
name: string;
|
|
73
|
+
fields: Map<string, InputField>;
|
|
74
|
+
extension: boolean;
|
|
75
|
+
inaccessible: boolean;
|
|
76
|
+
tags: Set<string>;
|
|
77
|
+
isDefinition: boolean;
|
|
78
|
+
description?: Description;
|
|
79
|
+
}
|
|
80
|
+
export interface UnionType {
|
|
81
|
+
kind: TypeKind.UNION;
|
|
82
|
+
name: string;
|
|
83
|
+
members: Set<string>;
|
|
84
|
+
tags: Set<string>;
|
|
85
|
+
inaccessible: boolean;
|
|
86
|
+
isDefinition: boolean;
|
|
87
|
+
description?: Description;
|
|
88
|
+
}
|
|
89
|
+
export interface EnumType {
|
|
90
|
+
kind: TypeKind.ENUM;
|
|
91
|
+
name: string;
|
|
92
|
+
values: Map<string, EnumValue>;
|
|
93
|
+
inaccessible: boolean;
|
|
94
|
+
tags: Set<string>;
|
|
95
|
+
isDefinition: boolean;
|
|
96
|
+
description?: Description;
|
|
97
|
+
referencedByInputType: boolean;
|
|
98
|
+
referencedByOutputType: boolean;
|
|
99
|
+
inputTypeReferences: Set<string>;
|
|
100
|
+
outputTypeReferences: Set<string>;
|
|
101
|
+
}
|
|
102
|
+
export interface Field {
|
|
103
|
+
name: string;
|
|
104
|
+
type: string;
|
|
105
|
+
args: Map<string, Argument>;
|
|
106
|
+
external: boolean;
|
|
107
|
+
inaccessible: boolean;
|
|
108
|
+
override: string | null;
|
|
109
|
+
provides: string | null;
|
|
110
|
+
requires: string | null;
|
|
111
|
+
required: boolean;
|
|
112
|
+
provided: boolean;
|
|
113
|
+
shareable: boolean;
|
|
114
|
+
used: boolean;
|
|
115
|
+
tags: Set<string>;
|
|
116
|
+
description?: Description;
|
|
117
|
+
deprecated?: Deprecated;
|
|
118
|
+
ast: {
|
|
119
|
+
directives: DirectiveNode[];
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
export interface InputField {
|
|
123
|
+
name: string;
|
|
124
|
+
type: string;
|
|
125
|
+
inaccessible: boolean;
|
|
126
|
+
tags: Set<string>;
|
|
127
|
+
defaultValue?: string;
|
|
128
|
+
description?: Description;
|
|
129
|
+
deprecated?: Deprecated;
|
|
130
|
+
}
|
|
131
|
+
export interface EnumValue {
|
|
132
|
+
name: string;
|
|
133
|
+
inaccessible: boolean;
|
|
134
|
+
tags: Set<string>;
|
|
135
|
+
description?: Description;
|
|
136
|
+
deprecated?: Deprecated;
|
|
137
|
+
}
|
|
138
|
+
export interface Argument {
|
|
139
|
+
name: string;
|
|
140
|
+
type: string;
|
|
141
|
+
inaccessible: boolean;
|
|
142
|
+
tags: Set<string>;
|
|
143
|
+
defaultValue?: string;
|
|
144
|
+
description?: Description;
|
|
145
|
+
deprecated?: Deprecated;
|
|
146
|
+
ast: {
|
|
147
|
+
directives: DirectiveNode[];
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
export interface Key {
|
|
151
|
+
fields: string;
|
|
152
|
+
resolvable: boolean;
|
|
153
|
+
}
|
|
154
|
+
export interface Description {
|
|
155
|
+
value: string;
|
|
156
|
+
block: boolean;
|
|
157
|
+
}
|
|
158
|
+
export interface Deprecated {
|
|
159
|
+
reason?: string;
|
|
160
|
+
deprecated: true;
|
|
161
|
+
}
|
|
162
|
+
export interface SubgraphState {
|
|
163
|
+
graph: {
|
|
164
|
+
id: string;
|
|
165
|
+
name: string;
|
|
166
|
+
version: FederationVersion;
|
|
167
|
+
url?: string;
|
|
168
|
+
};
|
|
169
|
+
types: Map<string, SubgraphType>;
|
|
170
|
+
schema: {
|
|
171
|
+
queryType?: string;
|
|
172
|
+
mutationType?: string;
|
|
173
|
+
subscriptionType?: string;
|
|
174
|
+
};
|
|
175
|
+
links: readonly Link[];
|
|
176
|
+
specs: {
|
|
177
|
+
tag: boolean;
|
|
178
|
+
inaccessible: boolean;
|
|
179
|
+
link: boolean;
|
|
180
|
+
};
|
|
181
|
+
version: FederationVersion;
|
|
182
|
+
}
|
|
183
|
+
export type SubgraphStateBuilder = ReturnType<typeof createSubgraphStateBuilder>;
|
|
184
|
+
export declare function createSubgraphStateBuilder(graph: {
|
|
185
|
+
id: string;
|
|
186
|
+
name: string;
|
|
187
|
+
url?: string;
|
|
188
|
+
}, typeDefs: DocumentNode, version: FederationVersion, links: readonly Link[]): {
|
|
189
|
+
directive: {
|
|
190
|
+
setComposed(directiveName: string): void;
|
|
191
|
+
setLocation(directiveName: string, location: string): void;
|
|
192
|
+
setRepeatable(directiveName: string): void;
|
|
193
|
+
arg: {
|
|
194
|
+
setTag(directiveName: string, argName: string, tag: string): void;
|
|
195
|
+
setType(directiveName: string, argName: string, argType: string): void;
|
|
196
|
+
setDirective(typeName: string, argName: string, directive: DirectiveNode): void;
|
|
197
|
+
setDefaultValue(typeName: string, argName: string, defaultValue: string): void;
|
|
198
|
+
setInaccessible(typeName: string, argName: string): void;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
scalarType: {
|
|
202
|
+
setDefinition(typeName: string): void;
|
|
203
|
+
setInaccessible(typeName: string): void;
|
|
204
|
+
setTag(typeName: string, tag: string): void;
|
|
205
|
+
setDirective(typeName: string, directive: DirectiveNode): void;
|
|
206
|
+
setDescription(typeName: string, description: Description): void;
|
|
207
|
+
setSpecifiedBy(typeName: string, url: string): void;
|
|
208
|
+
};
|
|
209
|
+
objectType: {
|
|
210
|
+
setDefinition(typeName: string): void;
|
|
211
|
+
setExtension(typeName: string, extensionType: "@extends" | "extend"): void;
|
|
212
|
+
setDescription(typeName: string, description: Description): void;
|
|
213
|
+
setExternal(typeName: string): void;
|
|
214
|
+
setInterface(typeName: string, interfaceName: string): void;
|
|
215
|
+
setKey(typeName: string, fields: string, fieldsUsedInKey: Set<string>, resolvable: boolean): void;
|
|
216
|
+
setInaccessible(typeName: string): void;
|
|
217
|
+
setShareable(typeName: string): void;
|
|
218
|
+
setTag(typeName: string, tag: string): void;
|
|
219
|
+
setDirective(typeName: string, directive: DirectiveNode): void;
|
|
220
|
+
field: {
|
|
221
|
+
setType(typeName: string, fieldName: string, fieldType: string): void;
|
|
222
|
+
setDirective(typeName: string, fieldName: string, directive: DirectiveNode): void;
|
|
223
|
+
setDescription(typeName: string, fieldName: string, description: Description): void;
|
|
224
|
+
setDeprecated(typeName: string, fieldName: string, reason?: string | undefined): void;
|
|
225
|
+
setExternal(typeName: string, fieldName: string): void;
|
|
226
|
+
setInaccessible(typeName: string, fieldName: string): void;
|
|
227
|
+
setOverride(typeName: string, fieldName: string, override: string): void;
|
|
228
|
+
setProvides(typeName: string, fieldName: string, provides: string): void;
|
|
229
|
+
setRequires(typeName: string, fieldName: string, requires: string): void;
|
|
230
|
+
markAsProvided(typeName: string, fieldName: string): void;
|
|
231
|
+
markedAsRequired(typeName: string, fieldName: string): void;
|
|
232
|
+
setShareable(typeName: string, fieldName: string): void;
|
|
233
|
+
setTag(typeName: string, fieldName: string, tag: string): void;
|
|
234
|
+
setUsed(typeName: string, fieldName: string): void;
|
|
235
|
+
arg: {
|
|
236
|
+
setType(typeName: string, fieldName: string, argName: string, argType: string): void;
|
|
237
|
+
setDescription(typeName: string, fieldName: string, argName: string, description: Description): void;
|
|
238
|
+
setDeprecated(typeName: string, fieldName: string, argName: string, reason?: string | undefined): void;
|
|
239
|
+
setDirective(typeName: string, fieldName: string, argName: string, directive: DirectiveNode): void;
|
|
240
|
+
setDefaultValue(typeName: string, fieldName: string, argName: string, defaultValue: string): void;
|
|
241
|
+
setInaccessible(typeName: string, fieldName: string, argName: string): void;
|
|
242
|
+
setTag(typeName: string, fieldName: string, argName: string, tag: string): void;
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
interfaceType: {
|
|
247
|
+
setDefinition(typeName: string): void;
|
|
248
|
+
setExtension(typeName: string): void;
|
|
249
|
+
setInterface(typeName: string, interfaceName: string): void;
|
|
250
|
+
setKey(typeName: string, fields: string, fieldsUsedInKey: Set<string>, resolvable: boolean): void;
|
|
251
|
+
setInaccessible(typeName: string): void;
|
|
252
|
+
setTag(typeName: string, tag: string): void;
|
|
253
|
+
setDirective(typeName: string, directive: DirectiveNode): void;
|
|
254
|
+
setDescription(typeName: string, description: Description): void;
|
|
255
|
+
field: {
|
|
256
|
+
setType(typeName: string, fieldName: string, fieldType: string): void;
|
|
257
|
+
setExternal(typeName: string, fieldName: string): void;
|
|
258
|
+
setInaccessible(typeName: string, fieldName: string): void;
|
|
259
|
+
setOverride(typeName: string, fieldName: string, override: string): void;
|
|
260
|
+
setRequires(typeName: string, fieldName: string, requires: string): void;
|
|
261
|
+
setShareable(typeName: string, fieldName: string): void;
|
|
262
|
+
setTag(typeName: string, fieldName: string, tag: string): void;
|
|
263
|
+
setUsed(typeName: string, fieldName: string): void;
|
|
264
|
+
setDirective(typeName: string, fieldName: string, directive: DirectiveNode): void;
|
|
265
|
+
setDescription(typeName: string, fieldName: string, description: Description): void;
|
|
266
|
+
setDeprecated(typeName: string, fieldName: string, reason?: string | undefined): void;
|
|
267
|
+
arg: {
|
|
268
|
+
setType(typeName: string, fieldName: string, argName: string, argType: string): void;
|
|
269
|
+
setDefaultValue(typeName: string, fieldName: string, argName: string, defaultValue: string): void;
|
|
270
|
+
setDeprecated(typeName: string, fieldName: string, argName: string, reason?: string | undefined): void;
|
|
271
|
+
setDescription(typeName: string, fieldName: string, argName: string, description: Description): void;
|
|
272
|
+
setTag(typeName: string, fieldName: string, argName: string, tag: string): void;
|
|
273
|
+
setInaccessible(typeName: string, fieldName: string, argName: string): void;
|
|
274
|
+
setDirective(typeName: string, fieldName: string, argName: string, directive: DirectiveNode): void;
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
inputObjectType: {
|
|
279
|
+
setDefinition(typeName: string): void;
|
|
280
|
+
setExtension(typeName: string): void;
|
|
281
|
+
setDescription(typeName: string, description: Description): void;
|
|
282
|
+
setInaccessible(typeName: string): void;
|
|
283
|
+
setTag(typeName: string, tag: string): void;
|
|
284
|
+
field: {
|
|
285
|
+
setType(typeName: string, fieldName: string, fieldType: string): void;
|
|
286
|
+
setDescription(typeName: string, fieldName: string, description: Description): void;
|
|
287
|
+
setDeprecated(typeName: string, fieldName: string, reason?: string | undefined): void;
|
|
288
|
+
setDefaultValue(typeName: string, fieldName: string, defaultValue: string): void;
|
|
289
|
+
setInaccessible(typeName: string, fieldName: string): void;
|
|
290
|
+
setTag(typeName: string, fieldName: string, tag: string): void;
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
unionType: {
|
|
294
|
+
setDefinition(typeName: string): void;
|
|
295
|
+
setInaccessible(typeName: string): void;
|
|
296
|
+
setTag(typeName: string, tag: string): void;
|
|
297
|
+
setDescription(typeName: string, description: Description): void;
|
|
298
|
+
setMember(typeName: string, member: string): void;
|
|
299
|
+
};
|
|
300
|
+
enumType: {
|
|
301
|
+
setDefinition(typeName: string): void;
|
|
302
|
+
setInaccessible(typeName: string): void;
|
|
303
|
+
setDescription(typeName: string, description: Description): void;
|
|
304
|
+
setTag(typeName: string, tag: string): void;
|
|
305
|
+
setReferencedByInputType(typeName: string, schemaCoordinate: string): void;
|
|
306
|
+
setReferencedByOutputType(typeName: string, schemaCoordinate: string): void;
|
|
307
|
+
value: {
|
|
308
|
+
setValue(typeName: string, valueName: string): void;
|
|
309
|
+
setDescription(typeName: string, valueName: string, description: Description): void;
|
|
310
|
+
setInaccessible(typeName: string, valueName: string): void;
|
|
311
|
+
setTag(typeName: string, valueName: string, tag: string): void;
|
|
312
|
+
setDeprecated(typeName: string, valueName: string, reason?: string | undefined): void;
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
composedDirectives: Set<string>;
|
|
316
|
+
state: SubgraphState;
|
|
317
|
+
markSpecAsUsed(specName: keyof SubgraphState['specs']): void;
|
|
318
|
+
visitor(typeNodeInfo: TypeNodeInfo): ASTVisitor;
|
|
319
|
+
};
|
|
320
|
+
export declare function cleanSubgraphStateFromFederationSpec(state: SubgraphState): SubgraphState;
|
|
321
|
+
export declare function cleanSubgraphStateFromLinkSpec(state: SubgraphState): SubgraphState;
|
|
322
|
+
//# sourceMappingURL=state.d.ts.map
|