Skip to content

Graphql Plugin - Mutation not traced & throw errors #174

@quentin-

Description

@quentin-

👋,

I think it's because of a typo here "mutations" instead of "mutation":
https://github.com/DataDog/dd-trace-js/blob/master/src/plugins/graphql.js#L257

While debugging this I also discovered that this does not work as intended:
https://github.com/DataDog/dd-trace-js/blob/master/src/plugins/graphql.js#L15-L17

This might use the patched schema, because the object is never deeply copied.
I could reproduce this like so:

  1. start graphql server
  2. run mutation, works fine (does not wrap anything since there's a typo)
  3. run query, schema is mutated
  4. run mutation, throw errors: contextValue in undefined in #resolveField

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions