# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= python-graphql-relay VERSION= 3.2.0 KEYWORDS= python VARIANTS= v12 v13 SDESC[v12]= Relay library for graphql-core (3.12) SDESC[v13]= Relay library for graphql-core (3.13) HOMEPAGE= https://github.com/graphql-python/graphql-relay-py CONTACT= Python_Automaton[python@ironwolf.systems] DOWNLOAD_GROUPS= main SITES[main]= PYPIWHL/74/16/a4cf06adbc711bd364a73ce043b0b08d8fa5aae3df11b6ee4248bcdad2e0 DISTFILE[1]= graphql_relay-3.2.0-py3-none-any.whl:main DIST_SUBDIR= python-src DF_INDEX= 1 SPKGS[v12]= single SPKGS[v13]= single OPTIONS_AVAILABLE= PY312 PY313 OPTIONS_STANDARD= none VOPTS[v12]= PY312=ON PY313=OFF VOPTS[v13]= PY312=OFF PY313=ON DISTNAME= graphql_relay-3.2.0.dist-info GENERATED= yes [PY312].RUN_DEPENDS_ON= python-graphql-core:single:v12 [PY312].USES_ON= python:v12,wheel [PY313].RUN_DEPENDS_ON= python-graphql-core:single:v13 [PY313].USES_ON= python:v13,wheel [FILE:3273:descriptions/desc.single] # Relay Library for GraphQL Python GraphQL-relay-py is the [Relay] library for [GraphQL-core]. It allows the easy creation of Relay-compliant servers using GraphQL-core. GraphQL-Relay-Py is a Python port of [graphql-relay-js], while GraphQL-Core is a Python port of [GraphQL.js], the reference implementation of GraphQL for JavaScript. Since version 3, GraphQL-Relay-Py and GraphQL-Core support Python 3.6 and above only. For older versions of Python, you can use version 2 of these libraries. [PyPI version] ![Test Status] ![Lint Status] [Dependency Updates] [Python 3 Status] [Code Style] ## Getting Started A basic understanding of GraphQL and of the GraphQL Python implementation is needed to provide context for this library. An overview of GraphQL in general is available in the [README] for the [Specification for GraphQL]. This library is designed to work with the the [GraphQL-Core] Python reference implementation of a GraphQL server. An overview of the functionality that a Relay-compliant GraphQL server should provide is in the [GraphQL Relay Specification] on the [Relay website]. That overview describes a simple set of examples that exist as [tests] in this repository. A good way to get started with this repository is to walk through that documentation and the corresponding tests in this library together. ## Using Relay Library for GraphQL Python (graphql-core) Install Relay Library for GraphQL Python ```sh pip install graphql-core pip install graphql-relay ``` When building a schema for [GraphQL], the provided library functions can be used to simplify the creation of Relay patterns. All the functions that are explained in the following sections must be imported from the top level of the `graphql_relay` package, like this: `python from graphql_relay import connection_definitions ` ### Connections Helper functions are provided for both building the GraphQL types for connections and for implementing the `resolve` method for fields returning those types. - `connection_args` returns the arguments that fields should provide when they return a connection type that supports bidirectional pagination. - `forward_connection_args` returns the arguments that fields should provide when they return a connection type that only supports forward pagination. - `backward_connection_args` returns the arguments that fields should provide when they return a connection type that only supports backward pagination. - `connection_definitions` returns a `connection_type` and its associated `edgeType`, given a name and a node type. - `connection_from_array` is a helper method that takes an array and the arguments from `connection_args`, does pagination and filtering, and returns an object in the shape expected by a `connection_type`'s `resolve` function. - `cursor_for_object_in_connection` is a helper method that takes an array and a member object, and returns a cursor for use in the mutation payload. - `offset_to_cursor` takes the index of a member object in an array and returns an opaque cursor for use in the mutation payload. - `cursor_to_offset` takes an opaque cursor (created with `offset_to_cursor`) and returns the corresponding array index. An example usage of these methods from the [test schema]: ```python [FILE:126:distinfo] c9b22bd28b170ba1fe674c74384a8ff30a76c8e26f88ac3aa1584dd3179953e5 16940 python-src/graphql_relay-3.2.0-py3-none-any.whl