Skip to content

hpohlmeyer/graphql-tools-bug-repro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup

  1. Run npm install
  2. Run npm run start:transformed
  3. Go to http://localhost:4000
  4. Klick on the button to go to Apollo Studio

Reproduce the issue

The following query works as expected

query Test {
  xx_missions {
    payloads {
      orbit_params {
        eccentricity
      }
    }
  }
}
Results

{
  "data": {
    "xx_missions": [
      {
        "payloads": [
          {
            "orbit_params": {
              "eccentricity": 0.0001981
            }
          },
          {
            "orbit_params": {
              "eccentricity": 0.0001844
            }
          }
        ]
      },
      {
        "payloads": [
          {
            "orbit_params": {
              "eccentricity": 0.0002221
            }
          },
          {
            "orbit_params": {
              "eccentricity": 0.0001916
            }
          }
        ]
      }
      // ...
    ]
  }
}

The and returns data all the way down to eccentricity.

But once we alias payloads, it will always return null:

query Test {
  xx_missions {
    myPayloads: payloads {
      orbit_params {
        eccentricity
      }
    }
  }
}
Results

{
  "data": {
    "xx_missions": [
      {
        "myPayloads": null
      },
      {
        "myPayloads": null
      },
      // ...
    ]
  }
}

In this case all the fields are optional, but if they aren’t the query will fail, but even with optional fields, this is not the expected behavior.

Untransformed version

You can get the untransformed version by running npm run start:untransformed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published