Skip to content

Conversation

leszekhanusz
Copy link
Collaborator

The Client of gql allows us now to pass a local schema either:

  • with the schema argument if the schema is a GraphQLSchema type
  • with the type_def argument if the schema is passed as a string

But this is basically the same thing expressed with different types.

I propose to simplify the documentation that the type_def argument becomes deprecated and that the local schema is passed using the schema argument for both types.

To summarize, you should use schema= now instead of previously type_def= in the Client.

The schema argument will accept either:

  • a string (previously passed to the type_def argument)
  • a GraphQLSchema (like before)

You should use 'schema=' now instead of 'type_def='
The schema argument will accept either:
- a string (previously passed to the type_def argument)
- a GraphQLSchema
@coveralls
Copy link

coveralls commented Jul 12, 2020

Coverage Status

Coverage remained the same at 100.0% when pulling 0e08621 on leszekhanusz:deprecated_type_def_argument into c0bec62 on graphql-python:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling c97647e on leszekhanusz:deprecated_type_def_argument into faadac4 on graphql-python:master.

Copy link
Contributor

@KingDarBoja KingDarBoja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather have removed the type_def argument and mark as breaking change for gql v3.

@KingDarBoja KingDarBoja added the type: feature A new feature label Jul 12, 2020
@KingDarBoja KingDarBoja added this to the Version 3.0 milestone Jul 12, 2020
@leszekhanusz
Copy link
Collaborator Author

I would rather have removed the type_def argument and mark as breaking change for gql v3.

We could leave it as deprecated now and remove it once we are at the stable 3.0 ?

@KingDarBoja
Copy link
Contributor

I would rather have removed the type_def argument and mark as breaking change for gql v3.

We could leave it as deprecated now and remove it once we are at the stable 3.0 ?

Well I am okay with that as long as it doesn't stay for more than 2 minor releases after stable 😄

@leszekhanusz leszekhanusz merged commit 1ec139d into graphql-python:master Jul 12, 2020
@leszekhanusz leszekhanusz deleted the deprecated_type_def_argument branch July 18, 2020 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants