Skip to content

Commit

Permalink
Fix copy/paste error with printedTagDefinition
Browse files Browse the repository at this point in the history
  • Loading branch information
sachindshinde committed Apr 7, 2022
1 parent 6d30eb6 commit bd179d5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internals-js/src/inaccessibleSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const inaccessibleIdentity = 'https://specs.apollo.dev/inaccessible';
export class InaccessibleSpecDefinition extends FeatureDefinition {
public readonly inaccessibleLocations: DirectiveLocation[];
public readonly inaccessibleDirectiveSpec: DirectiveSpecification;
private readonly printedTagDefinition: string;
private readonly printedInaccessibleDefinition: string;

constructor(version: FeatureVersion) {
super(new FeatureUrl(inaccessibleIdentity, 'inaccessible', version));
Expand All @@ -47,7 +47,7 @@ export class InaccessibleSpecDefinition extends FeatureDefinition {
DirectiveLocation.INTERFACE,
DirectiveLocation.UNION,
];
this.printedTagDefinition = 'directive @inaccessible on FIELD_DEFINITION | INTERFACE | OBJECT | UNION';
this.printedInaccessibleDefinition = 'directive @inaccessible on FIELD_DEFINITION | INTERFACE | OBJECT | UNION';
if (!this.isV01()) {
this.inaccessibleLocations.push(
DirectiveLocation.ARGUMENT_DEFINITION,
Expand All @@ -57,7 +57,7 @@ export class InaccessibleSpecDefinition extends FeatureDefinition {
DirectiveLocation.INPUT_OBJECT,
DirectiveLocation.INPUT_FIELD_DEFINITION,
);
this.printedTagDefinition = 'directive @inaccessible on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION';
this.printedInaccessibleDefinition = 'directive @inaccessible on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION';
}
this.inaccessibleDirectiveSpec = createDirectiveSpecification({
name: 'inaccessible',
Expand All @@ -83,7 +83,7 @@ export class InaccessibleSpecDefinition extends FeatureDefinition {
const hasValidLocations = definition.locations.every(loc => this.inaccessibleLocations.includes(loc));
if (hasUnknownArguments || hasRepeatable || !hasValidLocations) {
return ERRORS.DIRECTIVE_DEFINITION_INVALID.err({
message: `Found invalid @inaccessible directive definition. Please ensure the directive definition in your schema's definitions matches the following:\n\t${this.printedTagDefinition}`,
message: `Found invalid @inaccessible directive definition. Please ensure the directive definition in your schema's definitions matches the following:\n\t${this.printedInaccessibleDefinition}`,
});
}
return undefined;
Expand Down

0 comments on commit bd179d5

Please sign in to comment.