graphql-python / graphql-python/graphene

When sending multiple invalid values, response errors only contains the first failure

Aperta
#1,164 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub
🐛 bug
Lingua principale
Python
Stelle
8.2k
Fork
818
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

using graphene-2.1.8
When passing query data to the below query
we only get one error when two are expected
```
class SubscriptionPlanObjects(graphene.ObjectType):
subscription_plan_objects = graphene.List(
graphene.NonNull(graphql.SubscriptionPlanObject),
subscriber_id=graphene.Int(required=True),
subscriber_type=graphene.String(required=True),
target_currency=graphene.String(required=True),
)

def resolve_subscription_plan_objects(
self, info, subscriber_id, subscriber_type, target_currency
):
pass

query = """
query subscriptionPlanObjects ($subscriberId: Int!, $subscriberType: String!, $targetCurrency: String!) {
subscriptionPlanObjects (subscriberId: $subscriberId, subscriberType: $subscriberType, targetCurrency: $targetCurrency) {
id
}
}
"""
test_schema = build_schema(query=SubscriptionPlanObjects)
gql_client = Client(test_schema)
response = gql_client.execute(self.query, variables=kwargs)
```
data like:
```
kwargs = {
"subscriberId": None,
"subscriberType": 3,
"targetCurrency": "usd"
}
```
We only get the one error, response["errors"] is
```
[
{
'locations': [{'column': 40, 'line': 2}],
'message': 'Variable "$subscriberId" of required type "Int!" was not provided.'
}
]
```
When we should also get an error on the subscriberType argument because it is not type String!

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.