Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Unknown directive \"@defer\ and @stream #1372

Closed
koo27 opened this issue Jul 8, 2022 · 1 comment
Closed

Unknown directive \"@defer\ and @stream #1372

koo27 opened this issue Jul 8, 2022 · 1 comment

Comments

@koo27
Copy link

koo27 commented Jul 8, 2022

Describe the bug

I'm trying to use the two directives @defer and @stream with no luck.
I set up a simple grapqhl yoga server, but the response I get from graphiQL is always "Unknown directive".
Here is a response example

{
  "data": null,
  "errors": [
    {
      "message": "Unknown directive \"@defer\".",
      "locations": [
        {
          "line": 5,
          "column": 17
        }
      ],
      "extensions": {}
    },
    {
      "message": "Unknown directive \"@stream\".",
      "locations": [
        {
          "line": 8,
          "column": 13
        }
      ],
      "extensions": {}
    }
  ]
}

I also created a public report just for this test to let you try it out. This is the repo: https://github.com/koo27/defer-stream-test
I set up a urql client too, but I get the same response anyway.

What am I doing wrong?

Your Example Website or App

https://github.com/koo27/defer-stream-test

Steps to Reproduce the Bug or Issue

  1. Go to the test repo I linked
  2. clone it, install dependencies and start the server
  3. run a query with defer or stream

Expected behavior

I expect @defer and @stream to work

Screenshots or Videos

No response

Platform

  • OS: [macOS]
  • NodeJS: [e.g. 18.2.0]
  • "@graphql-yoga/node": "^2.12.0",
  • "graphql": "^16.5.0"

Additional context

No response

@saihaj
Copy link
Collaborator

saihaj commented Jul 8, 2022

Hey! @koo27 to use defer and stream you need to use experimental release from graphql-js https://github.com/graphql/graphql-js/releases/tag/v16.1.0-experimental-stream-defer.6 for new major release of graphql-yoga we plan to provide out of box support #1352

@saihaj saihaj closed this as completed Jul 8, 2022
Repository owner locked and limited conversation to collaborators Jul 8, 2022
@saihaj saihaj converted this issue into discussion #1373 Jul 8, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants