strawberry-graphql / strawberry

A GraphQL library for Python that leverages type annotations 🍓
https://strawberry.rocks
MIT License
3.87k stars 511 forks source link

Interfaces should not work with input types #1236

Open ZeroIntensity opened 2 years ago

ZeroIntensity commented 2 years ago

based on this stackoverflow question, graphql doesn't support interfaces with input types, and yet strawberry allows this:

import strawberry

@strawberry.interface
class SomeInterface:
    some_arg: str

@strawberry.input
class SomeInput(SomeInterface): # this should throw an error
    another_arg: str

Upvote & Fund

Fund with Polar

scratchmex commented 2 years ago

I think this could be implemented when #489 is done

BryceBeagle commented 2 years ago

Changes might be similar to https://github.com/strawberry-graphql/strawberry/pull/1222, but for input types instead of arguments