Skip to content

V3 subscription field with arguments throws an error #1247

Closed
@hyusetiawan

Description

@hyusetiawan

Note: for support questions, please use stackoverflow. This repository's issues are reserved for feature requests and bug reports.

  • What is the current behavior?
    I specify a subscription like so:
class SubscriptionDocument:
    # document_block_updates = graphene.List(
    #     DocumentBlockType, doc_uid=graphene.Argument(graphene.UUID, name="docUID")
    # )
    document_updates = graphene.Field(DocumentType, doc_uid=graphene.UUID())

    # async def subscribe_block_updates(self, info, **kwargs):
    #     while True:
    #         yield Document.objects.first()
    #         await asyncio.sleep(5)

    async def subscribe_document_updates(self, info, *args, **kwargs):
        count = 0
        doc_uid: UUID = kwargs.get("doc_uid", None)

        while True:
            count += 1
            yield sync_to_async(Document.objects.filter)(uid=doc_uid)
            await asyncio.sleep(5)

and I am getting an error:
identity_resolve() got an unexpected keyword argument 'doc_uid'

but the generated graphql schema works as expected and if I remove that doc_uid argument.

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via
    a github repo, https://repl.it or similar.

  • What is the expected behavior?
    works the way regular query should work

  • What is the motivation / use case for changing the behavior?
    not changing

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions