graphql-python / graphql-python/graphene

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

Open
#1,164 4 comments 0 reactions 0 assignees View on GitHub
🐛 bug
Dominant language
Python
Stars
8.2k
Forks
818
PR merge metrics
No merged PRs in 30d

Description

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!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.