Module cynic::selection_set[][src]

Expand description

SelectionSets are the core building block of GraphQL queries in cynic.

A SelectionSet represents part of a query with one or more fields that should be queried, and details of how those fields should be deserialized after the query is run.

The functions in this module fall into a few categories:

  1. Functions that decode scalar values, such as int & bool.
  2. Functions that decode container types such as vec & option. These take a selection set that is used to decode the contents of the container.
  3. The field function, which selects a particular field of an object, and uses another selection set to decode the type of that object.
  4. Combinators like the map, map2 etc, functions that combine multiple selection sets into a single type.

Cynic provides Query DSL generation & derive macros that mean for many cases you shouldn’t need to use the functions in this module directly. However for more advanced use cases (or if you dislike macros) these can still be useful.

Re-exports

pub use map as map1;

Structs

A SelectionSet is a combination of a set of fields to fetch as part of a GraphQL query and a decoder function that will decode the results of that query.

Traits

A marker trait used to encode GraphQL subtype relationships into the Rust typesystem.

Functions

Creates a SelectionSet that will decode a bool

Creates a SelectionSet for decoding a GQL enum with a function.

Creates a SelectionSet that always fails to decode.

Selects a field from a GraphQL object, decoding it with another SelectionSet

Selects an aliased field from a GraphQL object, decoding it with another SelectionSet

Creates a SelectionSet that will decode an f64

Creates a SelectionSet that adds some inline fragments to a query.

Creates a SelectionSet that will decode an i32

Creates a SelectionSet that will decode into a serde_json::Value

Applies a function to the result of a selection.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Applies a function to the result of some SelectionSets.

Creates a SelectionSet that decodes a nullable into an Option

Creates a SelectionSet that will decode a type that implements Scalar

Creates a SelectionSet that will decode a type that implements serde::Deserialize

Creates a SelectionSet that will decode a String

Creates a SelectionSet that always decodes succesfully to a particular value

Creates a SelectionSet that always decodes succesfully to the result of a function

Creates a SelectionSet that decodes a Vec of inner_selection