Fondamentaux

Qu’est-ce que c’est


Schema

Schema Definition Language (SDL)

Type pré-défini

Type objet

Type enum

Interface

Union

Fragment

Scalar

Type Query

Type Mutation

Type Subscription

Input

Descriptions

Directive

  1. Définir une directive
    Une directive peut prendre zéro ou plusieurs arguments — avec la même syntaxe que le type query.

     directive @notEmpty on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
    
     directive @range(min : Int = 0, max : Int = 2147483647) on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
    
     directive @date(format: String!) on FIELD_DEFINITION
    
  2. Ajouter la directive aux endroits appropriés.

     type Mutation {
       createPerson(name: String! @notEmpty, age: Int @range(max: 200)): Person!
     }
    
     scalar Date
    
     type Query {
       today: Date @date(format: "mmmm d, yyyy")
     }
    

@deprecated

Query

Requête query

Nesting

Paramètres

Multiples requêtes

Résultat nommé

Union

Fragment

Opération nommée

Variables

@skip

@include


Mutation


Subscription


Introspection

GraphiQL

GraphQL Playground