Skip to content

Commit

Permalink
fix(graphql): Lighthouse v6.34.0 compatibility (failed tests).
Browse files Browse the repository at this point in the history
  • Loading branch information
LastDragon-ru committed Mar 1, 2024
1 parent 2bfe45c commit ce67672
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 6 additions & 2 deletions packages/graphql/src/Builder/Directives/SchemaDirective.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
* Modifies the Schema for Directive.
*
* We are using special scalars to add operators. The directive provides a way
* to add and extend them. Extending is required because Lighthouse doesn't
* support adding directives from extensions nodes yet.
* to add and extend them. Extending is required because Lighthouse (until v6.34.0)
* doesn't support adding directives from extensions nodes yet.
*
* @see https://github.com/nuwave/lighthouse/issues/2509
* @see https://github.com/nuwave/lighthouse/pull/2512
Expand Down Expand Up @@ -72,6 +72,10 @@ public function __invoke(BuildSchemaString $event): string {

#[Override]
public function manipulateTypeDefinition(DocumentAST &$documentAST, TypeDefinitionNode &$typeDefinition): void {
// todo(graphql): Lighthouse since v6.34.0 merges directives from
// extension nodes except standard types. So the implementation can
// be simplified.

// Apply `extend scalar`.
$manipulator = $this->getAstManipulator($documentAST);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,3 @@ extend scalar SearchByOperatorsExtra
scalar Mixed
@scalar(class: "GraphQL\\Type\\Definition\\StringType")
@searchByOperatorEqual

extend scalar Mixed
@searchByOperatorNotEqual
1 change: 0 additions & 1 deletion packages/graphql/src/Utils/AstManipulatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ public function testGetDirectives(): void {
<<<'GRAPHQL'
extend scalar Int @aDirective @bDirective
scalar CustomScalar @bDirective @cDirective
extend scalar CustomScalar @aDirective
type Query {
test(arg: String @aDirective @cDirective): Test @all @bDirective
Expand Down

0 comments on commit ce67672

Please sign in to comment.