nuwave / lighthouse

A framework for serving GraphQL from Laravel
https://lighthouse-php.com
MIT License
3.33k stars 434 forks source link

`extend scalar X` directives are lost #2509

Closed LastDragon-ru closed 4 months ago

LastDragon-ru commented 4 months ago

Describe the bug

The resulting directives for Scalar

scalar Scalar 
@scalar(class: "GraphQL\\Type\\Definition\\StringType")
@directive(location: "scalar")

extend scalar Scalar 
@directive(location: "extend")

will be

scalar Scalar 
@scalar(class: "GraphQL\\Type\\Definition\\StringType")
@directive(location: "scalar")

Meanwhile the graphql-php gives both (as it should be):

scalar Scalar
@scalar(class: "GraphQL\\Type\\Definition\\StringType")
@directive(
    location: "scalar"
)
@directive(
    location: "extend"
)

Expected behavior/Solution

Scalar should have all directives from extension nodes.

Steps to reproduce

  1. Create the schema with extend scalar X @directive
  2. Print it

Lighthouse Version

v6.33.0