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.

get_node() never called

See original GitHub issue

Hi,

I’m trying to override get_node() but it never gets called… Am I doing it wrong?

(python 3.6, graphene-django 2.0)

# some imports

@convert_django_field.register(PointField)
def convert_PointField(field, registry=None):
    return graphene.String()


class SomeNode(DjangoObjectType):
    class Meta:
        model = SomeModel
        filter_fields = ['code', 'title', ]
        interfaces = (relay.Node, )

    def resolve_geometry(self, *_):
        logger.error(self.geometry)
        return '{}'.format(str(self.geometry))

    @classmethod
    def get_node(cls, info, id):
        # node = SomeModel.object.filter(width=0)
        logger.error("get_node()")  # This never gets fired?
        return {}

Any ideas?

thx!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ardenncommented, Sep 11, 2019

Add this to your schema

node = relay.Node.Field()

And query node not document

Isn’t this exactly what I did, my model is called Document, so my node is document

1reaction
japrogramercommented, Sep 11, 2019

Add this to your schema

node = relay.Node.Field()

And query node not document

Read more comments on GitHub >

github_iconTop Results From Across the Web

get_node method is not called - graphene python
I am experiencing an issue with get_node method in a django object type definition. The method doesn't seem to be called in my...
Read more >
Calling 'getNode()' on the ref of Animated component is no ...
Question I just upgrade my react native application to 0.62.0, and now my app keeps getting this warning box ReactNativeFiberHostComponent: ...
Read more >
DocumentManagementClient.GetNode() does not return ...
DocumentManagementClient.GetNode() does not return Metadata ... Calling Getnode(otauth,id) retrieves the node but Metadata is nothing.
Read more >
Creating and Retrieving Nodes — Katana Developer Guide
You can reference a node using the function GetNode() . For example, to retrieve a node called PrimitiveCreate use: primNode = NodegraphAPI.
Read more >
How can I call Slicer.util.getNode function in cpp code?
Hello,everyone: We can get node using Slicer.util. ... GetID(); if (fnmatch.fnmatchcase(name, pattern) or; fnmatch.fnmatchcase(id, ...
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