Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type_def argument of Client is now deprecated. #113

Merged

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.

gql/client.py Outdated Show resolved Hide resolved
gql/client.py Outdated Show resolved Hide resolved
@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.

None yet

3 participants