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

TestingOperation.flush expected enum but receive type in graphql:15 #2324

Open
magik9907 opened this issue Nov 22, 2024 · 2 comments
Open

TestingOperation.flush expected enum but receive type in graphql:15 #2324

magik9907 opened this issue Nov 22, 2024 · 2 comments

Comments

@magik9907
Copy link

magik9907 commented Nov 22, 2024

Describe the bug
While running tests for the versions listed below, the tests are failing with the error: Cannot read properties of undefined (reading 'SUBSCRIPTION').

Fail location in:

  • class TestOperation ,
  • method: flush,
  • line: 29

Code fragment where it's failed:

if (
    definition.kind === Kind.OPERATION_DEFINITION &&
    definition.operation !== OperationTypeNode.SUBSCRIPTION // <-- PROBLEM
  ) {
    this.complete();
  }

Reference:

Solution that worked:
After updating graphql to version 16, the tests are now passing

To Reproduce

Steps to reproduce the behavior:
Run test with dependencie version shown below.

Expected behavior

  • while installing packages, npm should show information with incompatible version for graphql:15.x.x and apollo-angular:8.*.*
    OR
  • while running tests with graphql:15.x.x and apollo-angular:8.*.*, they should passed

Environment:

Additional context

@magik9907 magik9907 changed the title Drop support for graphql:15 TestingOperation.flush expected enum but receive type in graphql:15 Nov 22, 2024
@PowerKiKi
Copy link
Collaborator

PR are welcome to fix this new limitation. Though I am wondering if we shouldn't just drop support for the old graphql v15 ? 🤔

Was there as specific reason for you to be on v15 ?

@magik9907
Copy link
Author

magik9907 commented Nov 23, 2024

In my case, I didn't see any reason to stay on v15 in project (it looks like it wasn't needed to update it earlier in project). I tested application with graphql:16 and it's worked ok (won't sure for 100% - maybe there is some specific cases but I might not saw it) and I think to keep that version in project.

I think it's good idead to drop support for v15 because there are works on graphql v17.

I have one more doubt, I run test for this project and it failed (for graphql:v15)
image

But in github actions it passed
image

I might be wrong, but it might failed only on unit tests but I don't see running unit test with graphql:15 but only e2e.
So, maybe it might good idea to run also additional unit tests for peer dependencies to check compatibility in PR for future changes.

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