@apollo/federation-internals
Advanced tools
Comparing version
@@ -103,2 +103,6 @@ import { ASTNode, GraphQLError, StringValueNode } from "graphql"; | ||
compareTo(other: FeatureVersion): number; | ||
lt(other: FeatureVersion): boolean; | ||
lte(other: FeatureVersion): boolean; | ||
gt(other: FeatureVersion): boolean; | ||
gte(other: FeatureVersion): boolean; | ||
strictlyGreaterThan(version: FeatureVersion): boolean; | ||
@@ -105,0 +109,0 @@ toString(): string; |
@@ -477,2 +477,14 @@ "use strict"; | ||
} | ||
lt(other) { | ||
return this.compareTo(other) < 0; | ||
} | ||
lte(other) { | ||
return this.compareTo(other) <= 0; | ||
} | ||
gt(other) { | ||
return this.compareTo(other) > 0; | ||
} | ||
gte(other) { | ||
return this.compareTo(other) >= 0; | ||
} | ||
strictlyGreaterThan(version) { | ||
@@ -479,0 +491,0 @@ return this.compareTo(version) > 0; |
@@ -98,3 +98,3 @@ "use strict"; | ||
locations: [graphql_1.DirectiveLocation.OBJECT, graphql_1.DirectiveLocation.FIELD_DEFINITION], | ||
repeatable: version >= (new coreSpec_1.FeatureVersion(2, 2)), | ||
repeatable: version.gte(new coreSpec_1.FeatureVersion(2, 2)), | ||
})); | ||
@@ -107,3 +107,3 @@ this.registerSubFeature(inaccessibleSpec_1.INACCESSIBLE_VERSIONS.getMinimumRequiredVersion(version)); | ||
})); | ||
if (version >= (new coreSpec_1.FeatureVersion(2, 1))) { | ||
if (version.gte(new coreSpec_1.FeatureVersion(2, 1))) { | ||
this.registerDirective((0, directiveAndTypeSpecification_1.createDirectiveSpecification)({ | ||
@@ -116,3 +116,3 @@ name: FederationDirectiveName.COMPOSE_DIRECTIVE, | ||
} | ||
if (version >= (new coreSpec_1.FeatureVersion(2, 3))) { | ||
if (version.gte(new coreSpec_1.FeatureVersion(2, 3))) { | ||
this.registerDirective((0, directiveAndTypeSpecification_1.createDirectiveSpecification)({ | ||
@@ -124,7 +124,7 @@ name: FederationDirectiveName.INTERFACE_OBJECT, | ||
} | ||
if (version >= (new coreSpec_1.FeatureVersion(2, 5))) { | ||
if (version.gte(new coreSpec_1.FeatureVersion(2, 5))) { | ||
this.registerSubFeature(authenticatedSpec_1.AUTHENTICATED_VERSIONS.find(new coreSpec_1.FeatureVersion(0, 1))); | ||
this.registerSubFeature(requiresScopesSpec_1.REQUIRES_SCOPES_VERSIONS.find(new coreSpec_1.FeatureVersion(0, 1))); | ||
} | ||
if (version >= (new coreSpec_1.FeatureVersion(2, 6))) { | ||
if (version.gte(new coreSpec_1.FeatureVersion(2, 6))) { | ||
this.registerSubFeature(policySpec_1.POLICY_VERSIONS.find(new coreSpec_1.FeatureVersion(0, 1))); | ||
@@ -131,0 +131,0 @@ } |
@@ -43,3 +43,3 @@ "use strict"; | ||
joinType.addArgument('resolvable', new definitions_1.NonNullType(schema.booleanType()), true); | ||
if (this.version >= (new coreSpec_1.FeatureVersion(0, 3))) { | ||
if (this.version.gte(new coreSpec_1.FeatureVersion(0, 3))) { | ||
joinType.addArgument('isInterfaceObject', new definitions_1.NonNullType(schema.booleanType()), false); | ||
@@ -50,3 +50,3 @@ } | ||
joinField.repeatable = true; | ||
const graphArgType = this.version >= (new coreSpec_1.FeatureVersion(0, 3)) | ||
const graphArgType = this.version.gte(new coreSpec_1.FeatureVersion(0, 3)) | ||
? graphEnum | ||
@@ -69,3 +69,3 @@ : new definitions_1.NonNullType(graphEnum); | ||
} | ||
if (this.version >= (new coreSpec_1.FeatureVersion(0, 3))) { | ||
if (this.version.gte(new coreSpec_1.FeatureVersion(0, 3))) { | ||
const joinUnionMember = this.addDirective(schema, 'unionMember').addLocations(graphql_1.DirectiveLocation.UNION); | ||
@@ -72,0 +72,0 @@ joinUnionMember.repeatable = true; |
{ | ||
"name": "@apollo/federation-internals", | ||
"version": "2.6.1", | ||
"version": "2.6.2", | ||
"description": "Apollo Federation internal utilities", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -693,2 +693,18 @@ import { ASTNode, DirectiveLocation, GraphQLError, StringValueNode } from "graphql"; | ||
public lt(other: FeatureVersion): boolean { | ||
return this.compareTo(other) < 0; | ||
} | ||
public lte(other: FeatureVersion): boolean { | ||
return this.compareTo(other) <= 0; | ||
} | ||
public gt(other: FeatureVersion): boolean { | ||
return this.compareTo(other) > 0; | ||
} | ||
public gte(other: FeatureVersion): boolean { | ||
return this.compareTo(other) >= 0; | ||
} | ||
/** | ||
@@ -695,0 +711,0 @@ * Return true if this FeatureVersion is strictly greater than the provided one, |
@@ -122,3 +122,3 @@ import { | ||
locations: [DirectiveLocation.OBJECT, DirectiveLocation.FIELD_DEFINITION], | ||
repeatable: version >= (new FeatureVersion(2, 2)), | ||
repeatable: version.gte(new FeatureVersion(2, 2)), | ||
})); | ||
@@ -134,3 +134,3 @@ | ||
if (version >= (new FeatureVersion(2, 1))) { | ||
if (version.gte(new FeatureVersion(2, 1))) { | ||
this.registerDirective(createDirectiveSpecification({ | ||
@@ -144,3 +144,3 @@ name: FederationDirectiveName.COMPOSE_DIRECTIVE, | ||
if (version >= (new FeatureVersion(2, 3))) { | ||
if (version.gte(new FeatureVersion(2, 3))) { | ||
this.registerDirective(createDirectiveSpecification({ | ||
@@ -153,3 +153,3 @@ name: FederationDirectiveName.INTERFACE_OBJECT, | ||
if (version >= (new FeatureVersion(2, 5))) { | ||
if (version.gte(new FeatureVersion(2, 5))) { | ||
this.registerSubFeature(AUTHENTICATED_VERSIONS.find(new FeatureVersion(0, 1))!); | ||
@@ -159,3 +159,3 @@ this.registerSubFeature(REQUIRES_SCOPES_VERSIONS.find(new FeatureVersion(0, 1))!); | ||
if (version >= (new FeatureVersion(2, 6))) { | ||
if (version.gte(new FeatureVersion(2, 6))) { | ||
this.registerSubFeature(POLICY_VERSIONS.find(new FeatureVersion(0, 1))!); | ||
@@ -162,0 +162,0 @@ } |
@@ -86,3 +86,3 @@ import { DirectiveLocation, GraphQLError } from 'graphql'; | ||
if (this.version >= (new FeatureVersion(0, 3))) { | ||
if (this.version.gte(new FeatureVersion(0, 3))) { | ||
joinType.addArgument('isInterfaceObject', new NonNullType(schema.booleanType()), false); | ||
@@ -97,3 +97,3 @@ } | ||
// an `@interfaceObject` type), and to indicate that, we use a `@join__field(graph: null)` annotation. | ||
const graphArgType = this.version >= (new FeatureVersion(0, 3)) | ||
const graphArgType = this.version.gte(new FeatureVersion(0, 3)) | ||
? graphEnum | ||
@@ -120,3 +120,3 @@ : new NonNullType(graphEnum); | ||
if (this.version >= (new FeatureVersion(0, 3))) { | ||
if (this.version.gte(new FeatureVersion(0, 3))) { | ||
const joinUnionMember = this.addDirective(schema, 'unionMember').addLocations(DirectiveLocation.UNION); | ||
@@ -123,0 +123,0 @@ joinUnionMember.repeatable = true; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
2007392
0.95%32155
0.13%163
-2.98%