pypi gql 3.0.0

latest releases: 3.6.0b2, 3.6.0b1, 3.6.0b0...
2 years ago

The graphql-python/gql stable version 3.0 is now finally available!

A lot of changes were made since the stable 2.x version and were available in the many pre-releases released since then. We now support async usage and subscriptions, new transports (aiohttp, websockets, phoenix channels, AWS appsync), file uploads, gql-cli script, completely revamped DSL module to compose GraphQL queries dynamically, custom scalars support... with 100% code coverage, typing hints and complete documentation.

This version needs graphql-core>=3.2.0 (#283)

Breaking changes since 2.x

  • Set use_json default True by default in requests transport (#16)
  • type_def argument in Client is now removed in favor of schema (#113) (#262)
  • The schema is now always fetched at the beginning of the first session if fetch_schema_from_transport is set to True (#167) Note that previously with 2.x versions, if the fetching of the schema failed, then the error was silently discarded. This is no more the case with 3.x versions and if you use fetch_schema_from_transport=True and there was a problem while getting the schema, then you'll get an Exception
  • Optional dependencies for transports (#158):
  • DSL module: see below
  • EDIT variable values: some users were apparently providing variable values using client.execute(query, variables) instead of client.execute(query, variable_values=variables). This no longer works in gql 3.0

New since 2.x

  • New websockets and aiohttp async transports using asyncio (#70). See async vs sync in the documentation
  • Implementation of graphql-ws protocol (#242)
  • File upload support (#145) with streaming functionalities (#174) for aiohttp or requests transport (#244)
  • gql-cli script
  • RequestHTTPTransport:
    • Support different operation names (#21)
    • Add extra_args argument to execute function (#232)
    • Update requests/urllib3 dependency and allow retries on POST requests (#249)
  • Custom Scalars input serialization in variables (#253)
  • Parse custom scalar and enums in outputs (#256)
  • Adding a new transport class to handle Phoenix channels (#100) (#228)
  • Supports AWS AppSync (#239)
  • Complete Refactor of the DSL Module (#169):
    • The DSLSchema only needs a schema, a Client is no more needed
    • New dsl_gql function to convert the DSL operations into a Document
    • This allows DSL queries to be executed in a session instead of a client (Solves #138)
    • Added typing annotations
    • Added code documentation and sphinx docs (Solves #82)
    • Supports Subscriptions
    • Fix nested input arguments
    • Allow to set the alias directly in the select method
    • Allow multiple operations in a document
    • Allow to set the operation name
    • Allow to use GraphQL keys named type (#151)
    • Add support for variable definitions (#210)
    • Implementation of fragments (#235)
    • Serialize complex arguments to literals (#255)
    • Meta fields implementation (#259)
    • Refactor select (#261)
  • Support extensions:
    • It is now possible to get the full execution result to receive the extensions field (#257)
    • Add extensions field to ExecutionResult (#190)
  • Enable mypy to discover type hints as specified in PEP 561 (#207)

Big thanks to @Cito for the graphql-core development and all the many contributors who contributed to this release!

Don't miss a new gql release

NewReleases is sending notifications on new releases.