[][src]Module cynic::selection_set

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

SelectionSet

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

HasSubtype

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

Functions

boolean

Creates a SelectionSet that will decode a bool

fail

Creates a SelectionSet that always fails to decode.

field

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

float

Creates a SelectionSet that will decode an f64

inline_fragments

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

integer

Creates a SelectionSet that will decode an i32

json

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

map

Applies a function to the result of a selection.

map2

Applies a function to the result of some SelectionSets.

map3

Applies a function to the result of some SelectionSets.

map4

Applies a function to the result of some SelectionSets.

map5

Applies a function to the result of some SelectionSets.

map6

Applies a function to the result of some SelectionSets.

map7

Applies a function to the result of some SelectionSets.

map8

Applies a function to the result of some SelectionSets.

map9

Applies a function to the result of some SelectionSets.

map10

Applies a function to the result of some SelectionSets.

map11

Applies a function to the result of some SelectionSets.

map12

Applies a function to the result of some SelectionSets.

map13

Applies a function to the result of some SelectionSets.

map14

Applies a function to the result of some SelectionSets.

map15

Applies a function to the result of some SelectionSets.

map16

Applies a function to the result of some SelectionSets.

map17

Applies a function to the result of some SelectionSets.

map18

Applies a function to the result of some SelectionSets.

map19

Applies a function to the result of some SelectionSets.

map20

Applies a function to the result of some SelectionSets.

map21

Applies a function to the result of some SelectionSets.

map22

Applies a function to the result of some SelectionSets.

map23

Applies a function to the result of some SelectionSets.

map24

Applies a function to the result of some SelectionSets.

map25

Applies a function to the result of some SelectionSets.

map26

Applies a function to the result of some SelectionSets.

map27

Applies a function to the result of some SelectionSets.

map28

Applies a function to the result of some SelectionSets.

map29

Applies a function to the result of some SelectionSets.

map30

Applies a function to the result of some SelectionSets.

map31

Applies a function to the result of some SelectionSets.

map32

Applies a function to the result of some SelectionSets.

map33

Applies a function to the result of some SelectionSets.

map34

Applies a function to the result of some SelectionSets.

map35

Applies a function to the result of some SelectionSets.

map36

Applies a function to the result of some SelectionSets.

map37

Applies a function to the result of some SelectionSets.

map38

Applies a function to the result of some SelectionSets.

map39

Applies a function to the result of some SelectionSets.

map40

Applies a function to the result of some SelectionSets.

map41

Applies a function to the result of some SelectionSets.

map42

Applies a function to the result of some SelectionSets.

map43

Applies a function to the result of some SelectionSets.

map44

Applies a function to the result of some SelectionSets.

map45

Applies a function to the result of some SelectionSets.

map46

Applies a function to the result of some SelectionSets.

map47

Applies a function to the result of some SelectionSets.

map48

Applies a function to the result of some SelectionSets.

map49

Applies a function to the result of some SelectionSets.

map50

Applies a function to the result of some SelectionSets.

option

Creates a SelectionSet that decodes a nullable into an Option

scalar

Creates a SelectionSet that will decode a type that implements Scalar

serde

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

string

Creates a SelectionSet that will decode a String

succeed

Creates a SelectionSet that always decodes succesfully to a particular value

vec

Creates a SelectionSet that decodes a Vec of inner_selection