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

Subscription result always null - what's the right format to yield? #575

Open
6 of 7 tasks
tigerinus opened this issue Jun 12, 2022 · 1 comment
Open
6 of 7 tasks

Comments

@tigerinus
Copy link

This is more of a question than bug

  • Explain with a simple sentence the expected behavior

Followed the doc, created a simple project that yields new data upon subscription. However at subscriber side (in GraphiQL) data is always

{
  "newLink": null
}

See my project at https://github.com/tigerinus/py-tartiflette-graphql-demo

Question: What's missing that causes this?

  • Tartiflette version:

1.4.1

  • Python version:

3.10.4

  • Executed in docker:

No

  • GraphQL Schema & Query:

Schema:

  type Query {
    info: String!
    feed: [Link!]!
  }

  type Mutation {
    postLink(url: String!, description: String!): Link!
  }

  type Subscription {
    newLink: Link
  }

  type Link {
    id: ID!
    description: String!
    url: String!
  }

Query:

query feed {
  feed {
    id
    description
    url
  }
}

mutation postLink {
  postLink(url:"asdf", description:"asdf") {
    id
  }
}

subscription newLink {
  newLink {
    id
    description
    url
  }
}
  • Is it a regression from a previous versions?

Not sure

  • Stack trace
@petertriho
Copy link

petertriho commented Jun 16, 2022

Try

link = await await queue.get()
yield { "newLink": link }

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