graphene icon indicating copy to clipboard operation
graphene copied to clipboard

Avoid ambiguity in graphene.Mutation docstring [documentation]

Open belkka opened this issue 4 years ago • 0 comments

The code example in docstring starts with from graphene import Mutation and defines a class Mutation later. This definition would shadow previously imported name and (which is more important) confuses a reader about usage of this class — one need to keep in mind that previous usage of Mutation is imported from graphene and have not been overridden yet.

This PR changes an "import-from" statement to an "import" statement, so graphene.Mutation is referred explicitly. This approach seems to be consistent with other code examples in the docs (e. g. see https://docs.graphene-python.org/en/v2.1.9/types/mutations/).

Another option is to change name of example class Mutation to something more explicit (maybe SchemaMutation or RootMutation), but I'm not sure what name to choose.

Only docstring is updated, no code changes.

belkka avatar Oct 11 '21 20:10 belkka