Graphql: Subscription Support

Created on 28 Oct 2020  ·  5Comments  ·  Source: graphql-go/graphql

Hey, it is very sad, that this project seems not being actively maintained.

I used it for some days now and sadly there are some things missing (real subscriptions, field names in queries etc.) so im switching to nodejs in my graphql microservice.

question

Most helpful comment

Hi @yhc44! –– Thanks for giving a try to the lib and sharing your thoughts:


Hey, it is very sad, that this project seems not being actively maintained.

Actually we do try our best to actively maintain it, this is a concern that was raised in a previous issue: Going out of life? and as pointed out in that issue hopefully we can catch-up on the awesome PRs that are to be reviewed & merge:

We have many awesome contributors that were improving the library along the way, hopefully we can catch-up closing more issues and merging PRs.
Ref: https://github.com/graphql-go/graphql/issues/527#issuecomment-581579779


I used it for some days now and sadly there are some things missing (real subscriptions, field names in queries etc.)

real subscriptions:

If you mean with real subscriptions having support for the subscribe property at the field definition level, yes this is a feature that hopefully we will be integrating soon via the PR#495.

But we do have Subscriptions support at the schema level since quite long time ago:

https://github.com/graphql-go/graphql/blob/2b0b7340d2285b861482047fbf5de0488e021bea/schema.go#L10

And here is a small working example: https://github.com/graphql-go/graphql/issues/49#issuecomment-404909227


field names in queries

If with field name in queries your referring to aliases, we do have alias support on queries:

1

etc.

If you could expand on this would be cool.

so im switching to nodejs in my graphql microservice.

That would be a good alternative since graphql-js have the latest GraphQL Spec features because the nature of being the reference implementation.

All 5 comments

Hi, @yhc44 Seems I'm going to do the same 👎 . I really wanted my graphql microservice was built in golang. It's so sad.

Hey @yhc44 and @rick-meli ,

I share your thoughts.. A while back, this was part of the reasons why I started developing a GraphQL package in Go, with a similar, but different approaches. Since then, the core implementation got into a stable phase, and the additional features are still in development, but at my company we are confident enough to use it in projects that are we are currently working on.

It has Subscriptions, Apollo Federation, field directives support, and many more features are coming, since I’m pumped to get them implemented, and personally we’ll also need them at work. So if you are still in the decision making, I would encourage you to check out the repo, see the examples, try it, check if it meet you needs and ask me any questions if you have.

rigglo/gql

Can you give a try will gqlgen? They generate go code from GraphQL schema, in-active development and subscription supported.

Hi @yhc44! –– Thanks for giving a try to the lib and sharing your thoughts:


Hey, it is very sad, that this project seems not being actively maintained.

Actually we do try our best to actively maintain it, this is a concern that was raised in a previous issue: Going out of life? and as pointed out in that issue hopefully we can catch-up on the awesome PRs that are to be reviewed & merge:

We have many awesome contributors that were improving the library along the way, hopefully we can catch-up closing more issues and merging PRs.
Ref: https://github.com/graphql-go/graphql/issues/527#issuecomment-581579779


I used it for some days now and sadly there are some things missing (real subscriptions, field names in queries etc.)

real subscriptions:

If you mean with real subscriptions having support for the subscribe property at the field definition level, yes this is a feature that hopefully we will be integrating soon via the PR#495.

But we do have Subscriptions support at the schema level since quite long time ago:

https://github.com/graphql-go/graphql/blob/2b0b7340d2285b861482047fbf5de0488e021bea/schema.go#L10

And here is a small working example: https://github.com/graphql-go/graphql/issues/49#issuecomment-404909227


field names in queries

If with field name in queries your referring to aliases, we do have alias support on queries:

1

etc.

If you could expand on this would be cool.

so im switching to nodejs in my graphql microservice.

That would be a good alternative since graphql-js have the latest GraphQL Spec features because the nature of being the reference implementation.

Hey @chris-ramon, thanks for your detailed answer.

With field names i mean for example

subscription {
  onCreateCluster {
    id
  }
}

I implemented your pubsub example, which is working fine. But how can i retrieve the field id in this example? I dont want to return all fields that i have on the specific object.

I just want to return

{
  id: '1337'
}

not

{
  id: '1337',
  ...allOtherFields (e.g name)
}

Sorry for my initial title btw. Was not very specific.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bbuck picture bbuck  ·  4Comments

titanous picture titanous  ·  3Comments

amedeiros picture amedeiros  ·  3Comments

schaze picture schaze  ·  4Comments

davejohnston picture davejohnston  ·  3Comments