Skip to content

Conversation

feirouu
Copy link

@feirouu feirouu commented Apr 14, 2020

No description provided.

@feirouu
Copy link
Author

feirouu commented Apr 14, 2020

I defined an interface.

class MutationResponse(Interface):
    code = Int(required=True, default_value=200)
    success = Boolean(required=True, default_value=True)
    message = String(required=True, default_value="something...")
class DoSomething(Mutation):
    class Meta:
        interfaces = (MutationResponse,)
    def mutate(self, info):
        return DoSomething()
print(DoSomething._meta.fields)

# output
OrderedDict()

# expected output
# {'code': <graphene.types.field.Field object at 0x112185970>, 'success': <graphene.types.field.Field object at 0x1121859a0>, 'message': <graphene.types.field.Field object at 0x112185a90>}

@feirouu feirouu closed this Apr 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant