Skip to content

Federation: change fields to follow the name converter convention #591

Open
@patrick91

Description

@patrick91

At the moment keys don't get camel cased (or rather, they don't use our name converter), so you need to specify the camel case version ie:

@strawberry.federation.type(keys=["my_key"])
class X:
    my_key: strawberry.ID

the resulting directive should be @key(fields:"myKey"), but now we get @key(fields:"my_key").

In a similar fashion when using resolve_reference we need to snake_case the arguments, as now we'd get myKey:

@strawberry.federation.type(keys=["my_key"])
class X:
    my_key: strawberry.ID

    def resolve_reference(self, myKey):
         ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions