Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin type error "Cannot read property 'value' of undefined" #84

Closed
albertstill opened this issue Jun 11, 2021 · 2 comments · Fixed by #100
Closed

Plugin type error "Cannot read property 'value' of undefined" #84

albertstill opened this issue Jun 11, 2021 · 2 comments · Fixed by #100
Assignees
Labels
bug Something isn't working

Comments

@albertstill
Copy link

Description

I fired a query to to my GraphQL server that had a schema error, a field included an argument that did not exist.

Got

{
  "error": {
    "errors": [
      {
        "message": "Cannot read property 'value' of undefined",
        "extensions": {
          "code": "INTERNAL_SERVER_ERROR"
        }
      }
    ]
  }
}

Expected Behavior

When I remove the plugin I get:

{
  "error": {
    "errors": [
      {
        "message": "Unknown argument \"activityType\" on field \"User.commutes\".",
        "locations": [
          {
            "line": 8,
            "column": 16
          }
        ],
        "extensions": {
          "code": "GRAPHQL_VALIDATION_FAILED"
        }
      }
    ]
  }
}

Your Environment

@newrelic/apollo-server-plugin@0.2.0 & Node 14.17.0

Additional context

I found the line that causes the type error, selection.name comes through as undefined sometimes.

parts.push(selection.name.value)

@albertstill albertstill added bug Something isn't working needs-triage labels Jun 11, 2021
@carlo-808 carlo-808 added this to Triage Needed: Unprioritized Features in Node.js Engineering Board via automation Jun 11, 2021
@carlo-808
Copy link
Contributor

Thank you @albertstill for submitting this bug along with the additional context. That is super helpful. We'll get this bug prioritized.

@michaelgoin michaelgoin moved this from Triage Needed: Unprioritized Features to To do: Features here are prioritized in Node.js Engineering Board Jun 15, 2021
@michaelgoin
Copy link
Member

Just ran into this for the first time with a federated query. Seems like we may need to 'skip' items w/o a name when grabbing from the document/selection set.

@michaelgoin michaelgoin added this to To Do in Apollo Federation Support via automation Jun 16, 2021
@bizob2828 bizob2828 moved this from To do: Features here are prioritized to In progress: Issues being worked on in Node.js Engineering Board Jul 1, 2021
@bizob2828 bizob2828 self-assigned this Jul 1, 2021
@bizob2828 bizob2828 moved this from To Do to In Progress in Apollo Federation Support Jul 1, 2021
@bizob2828 bizob2828 moved this from In progress: Issues being worked on to Needs PR Review in Node.js Engineering Board Jul 2, 2021
@bizob2828 bizob2828 moved this from In Progress to Needs PR Review in Apollo Federation Support Jul 2, 2021
Node.js Engineering Board automation moved this from Needs PR Review to Done: Issues recently completed Jul 2, 2021
Apollo Federation Support automation moved this from Needs PR Review to Done Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Node.js Engineering Board
  
Done: Issues recently completed
4 participants