- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 144
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Reporting issues with GraphQL-core 3
I came across an issue that may be due to Graphene but the problem surfaces here.
I was writing a mutation which would raise an Error or return:
{"data": {"someMutationThatReturnsNone": None}instead of something like:
{"data": {"someMutationThatWillAlwaysBeTrueIfNoErrorRaised": {"success": True}}}I was happy that this worked:
class SomeMutationThatReturnsNone(graphene.Mutation):
    class Arguments:
        ...
    Output = CustomNullTypeScalar
    def mutate(self, info: graphene.ResolveInfo, **kwargs: Any) -> None:
        ...
        return Noneuntil I realised that this would also work:
class SomeMutationThatReturnsNone(graphene.Mutation):
    class Arguments:
        ...
    Output = graphene.Date(required=True)
    def mutate(self, info: graphene.ResolveInfo, **kwargs: Any) -> None:
        ...
        return Nonecurrently, because the line of code linked above is before the check if is_leaf_type(return_type), so long as Output = someScalarOrEnumType the mutation will return {"data": {"someMutationThatReturnsNone": None}.
Which I don't think is right.
Would appreciate your thoughts.
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested