Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name argument ignored in NodeField (Relay) #1083

Closed
lucas-bremond opened this issue Oct 11, 2019 · 5 comments
Closed

Name argument ignored in NodeField (Relay) #1083

lucas-bremond opened this issue Oct 11, 2019 · 5 comments
Labels

Comments

@lucas-bremond
Copy link

lucas-bremond commented Oct 11, 2019

Looking at the node.py implementation:

class NodeField(Field):
    def __init__(self, node, type=False, deprecation_reason=None, name=None, **kwargs):
        assert issubclass(node, Node), "NodeField can only operate in Nodes"
        self.node_type = node
        self.field_type = type

        super(NodeField, self).__init__(
            # If we don's specify a type, the field type will be the node
            # interface
            type or node,
            description="The ID of the object",
            id=ID(required=True),
        )

the name argument is not passed to the super class.

Which means that:

CustomNode.Field(
        name = 'myCustomTypeName',
        type = MyCustomType,
        filterset_class = filters.MyCustomTypeFilter
)

does not create a myCustomTypeName type, but uses the default name.

Is there any reason for this?

@BossGrand
Copy link
Member

Looks like a bug to me

@stale
Copy link

stale bot commented Jan 29, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jan 29, 2020
@jkimbo jkimbo removed the wontfix label Jan 29, 2020
@j123b567
Copy link

This is probably duplicate of #1035 but because it is still not released, it is issue for graphene v2.x

@tcleonard
Copy link
Collaborator

This is probably duplicate of #1035 but because it is still not released, it is issue for graphene v2.x

This is indeed the same thing... I'm going to request to have it merged into the v2 branch as well as other librairies are still depending on the v2

@erikwrede
Copy link
Member

Fixed in Graphene v3, for now, no further v2 port is planned

@erikwrede erikwrede closed this as not planned Won't fix, can't repro, duplicate, stale Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants