Skip to content

Subscription field is missing #844

Closed

Description

@LarsKrogJensen

Trying to use the new subscription feature, but it seems that the enclosing subscription field is missing from the responses.

Example query:
subscription NewMessages { newMessage(roomId: 123) { sender text } }
Expected is a stream of:
{ "newMessage": { "sender": ".....", "text": "...." } }

But 'newMessage' is missing from the stream of updates, only receives a flat map with sender and text.

This is a least what I was expecting, could be wrong.

Played with an apollo base demo at WorldChat
where a request looks like:

{ subscription { Location(filter: {mutation_in: [CREATED, UPDATED]}) { mutation ... more } } }

and responses look like:
{ "Location": { "mutation":"UPDATED", ... more } }

Please note that the websocket messages is enclosed in the apollo framing protocol:
https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md

Is this a bug, or is there some way to get hold of the 'newMessage' field (could be aliased as well).

Activity

  1. bbakerman commented on Nov 28, 2017

    @bbakerman
    Member

    Re-reading the spec more closely I can confirm this is a bug

  2. added this to the 7.0 milestone on Nov 28, 2017
  3. self-assigned this
    on Dec 3, 2017
  4. bbakerman commented on Dec 5, 2017

    @bbakerman
    Member

    Now fixed

  5. LarsKrogJensen commented on Dec 6, 2017

    @LarsKrogJensen
    ContributorAuthor

    Nice, but the solution ignores a potential alias field. Should I open a new issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions