question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: "subscriptions are not allowed"

See original GitHub issue

Hey there, trying to get this set up in my project. I’ve gone through the README and set up the required pieces (I think). I’m now trying to use Graphiql to test out a subscription that I set up. When I do, I get this error response:

Subscriptions are not allowed. You will need to either use the subscribe function or pass allow_subscriptions=True

and can see this in stack trace as well:

  File "/Users/levinotik/.local/share/virtualenvs/great-control-ic_1WMqr/lib/python3.7/site-packages/graphql/execution/executor.py", line 176, in execute_operation
    "Subscriptions are not allowed. "

I must be missing something basic. Any ideas on what I’m doing wrong here? Thanks.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:76 (25 by maintainers)

github_iconTop GitHub Comments

8reactions
johnpaul89commented, Feb 18, 2020

Guys, I figured it out, I used the examples given in this tests with their schemas and they worked properly. So on my code I’ll modify it a little bit so that it can receive signals.

And also

@johnpaul89 The rest of your code looks fine at first glance. My guess is that it’s an issue with Django signals. Can you verify that your signals are firing properly? Something simple like this is a good test:

# signals.py
def trigger_graphene_subscriptions(sender, **kwargs):
    print('signals are working')
    post_save_subscription(sender, **kwargs)

post_save.connect(trigger_graphene_subscriptions, sender=ChatMessage, dispatch_uid="chat_message_post_save")

If your terminal doesn’t print that, it means your signals aren’t being read. What you do is try calling your app in init.py using your apps config default_app_config = 'subs.apps.SubsConfig'

Thanks @jaydenwindle for the package.

4reactions
fkromercommented, Feb 6, 2020

@levinotik I get an error. Could be an issue with graphql-core: https://github.com/graphql-python/graphql-core/issues/149.

{
  "errors": [
    {
      "message": "Subscription must return Async Iterable or Observable. Received: <Promise at 0x2bab7d44108 fulfilled with <rx.core.anonymousobservable.AnonymousObservable object at 0x000002BAB7D44348>>"
    }
  ],
  "data": null
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Subscriptions in Apollo Server - Apollo GraphQL Docs
Each subscription operation can subscribe to only one field of the Subscription type. Enabling subscriptions. Subscriptions are not supported by Apollo Server ......
Read more >
Flex sync when using Mixed type: error thrown that no ...
I am getting this error even though a subscription exists. The sub already exists, which you can verify thru the print statement output...
Read more >
Error "Subscription was not found" when trying to create Azure ...
You will be facing this issue because the Azure subscription is absolutely completely empty and the environment could not able to pick up...
Read more >
Subscriptions - Ariadne GraphQL
While queries offer a way to query a server once, subscriptions offer a way for the server ... Note: Name of class implementing...
Read more >
Error: Perpetual Subscription not aloowed - WordPress.org
Hi, after installation, I tried to place a test order but every time it is failing with an error message “Perpetual subscription not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found