Having trouble with AshGraphql subscriptions dsl

I created a subscription:
subscriptions do
pubsub __.Endpoint
subscribe :resource_name_updated do
action_types [:create, :update]
end
end
subscriptions do
pubsub __.Endpoint
subscribe :resource_name_updated do
action_types [:create, :update]
end
end
and subscribed like so:
subscription {
resourceNameUpdated {
created {
id
}
updated {
id
}
}
}
subscription {
resourceNameUpdated {
created {
id
}
updated {
id
}
}
}
This always returns the following (no matter if I called an update or create action):
{
"data": {
"resourceNameUpdated": {
"created": null,
"updated": {
"id": "fbc962bd-ed42-4a00-b050-76773d0db450"
}
}
}
}
{
"data": {
"resourceNameUpdated": {
"created": null,
"updated": {
"id": "fbc962bd-ed42-4a00-b050-76773d0db450"
}
}
}
}
The subscription itself works fine, but I can't get any results to flow through the created key in the response. If I remove the :update atom from action_types, the graphql would return properly underneath the create key:
{
"data": {
"resourceNameUpdated": {
"created": "fbc962bd-ed42-4a00-b050-76773d0db450"
}
}
}
{
"data": {
"resourceNameUpdated": {
"created": "fbc962bd-ed42-4a00-b050-76773d0db450"
}
}
}
4 Replies
barnabasj
barnabasj3mo ago
I will try to replicate and fix tomorrow Having a hard time reproducing, is your code visible somewhere. or can you create a new project with a failing subscription using the generators from ash-hq.org
ZachDaniel
ZachDaniel3mo ago
And open an issue as well
zeropoint
zeropointOP3mo ago
Yeah, will do today or tomorrow.
zeropoint
zeropointOP3mo ago
Oh, I see what was happening... my mistake 🙇‍♂️ . This is working properly. Sorry took me a while to figure out because of this: https://github.com/absinthe-graphql/absinthe_plug/issues/303 I was getting the :create notification and then a separate :update notification directly after because of an oban job that got triggered immediately.
GitHub
Version 1.5.9 broke the advanced graphql interface · Issue #303 ·...
While the new simple interface works, the Graphiql workspace, braeaks with this error:

Did you find this page helpful?