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

makeExecutableSchema fails if typeDefs includes a directive named toString #5967

Closed
4 tasks done
lesleydreyer opened this issue Mar 8, 2024 · 0 comments
Closed
4 tasks done

Comments

@lesleydreyer
Copy link
Contributor

lesleydreyer commented Mar 8, 2024

Issue workflow progress

Progress of the issue based on the
Contributor Workflow

  • 1. The issue provides a reproduction available on Github, Stackblitz or CodeSandbox

    Make sure to fork this template and run yarn generate in the terminal.

    Please make sure the GraphQL Tools package versions under package.json matches yours.

  • 2. A failing test has been provided
  • 3. A local solution has been provided
  • 4. A pull request is pending review

Describe the bug

if I pass a directive in typeDefs to makeExecutableSchema named @tostring it fails saying TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them at mergeDirective
If I change the toString to something like toBoolean it works so it seems to just be "toString"

To Reproduce Steps to reproduce the behavior:

const schema = makeExecutableSchema({
    typeDefs: `
        directive @toString on FIELD_DEFINITION | FIELD
        type Something {
            foo: String
        }`
});

Researching it but I think it might be happening because it's a method on the Object prototype in mergedResultMap on mergeGraphQLNodes.

https://codesandbox.io/p/devbox/brave-visvesvaraya-49xx8m

Expected behavior

Should be able to create a schema with a toString directive

Environment:

  • OS:
  • @graphql-tools/...:
  • NodeJS:

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants