Graphql

GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data.

 

– https://graphql.org/

2010

Creation de GraphQL par Facebook

2015

Publication de GraphQL en opensource 

2016

Adoption de GraphQL par Github

...

...

2023

Annonce d'une API GraphQL par Salesforce

Qu'est ce que graphql

  • Query language for APIs that is SQL-like and industry standard
  • Single endpoint for resources that works over existing APIs, aggregating multiple resources
  • Requests only the necessary data so you’re no longer under- or over-fetching data
  • Schema-driven and enables data introspection and easy to use developer tooling

-- Salesforce

  • Structure standard
  • Evite l'under et over fetch
  • WYAIWYG

Graphql

  • Facile et rapide a implémenter

Rest

{
  "data": {
    "__schema": {
      "queryType": {
        "name": "Query"
      },
      "mutationType": {
        "name": "Mutation"
      },
      "subscriptionType": null,
      "types": [
        {
          "kind": "SCALAR",
          "name": "Boolean",
          "description": "Represents `true` or `false` values.",
          "interfaces": null,
          "possibleTypes": null,
          "fields": null,
          "inputFields": null,
          "enumValues": null
        },
        {
          "kind": "OBJECT",
          "name": "Coopter",
          "description": null,
          "interfaces": [

          ],
          "possibleTypes": null,
          "fields": [
            {
              "name": "city",
              "description": "The city of the current job of the coopter",
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "company",
              "description": "The current company for which the coopter currently work for",
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "deleted",
              "description": "Is the coopter deleted",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "Boolean",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "email",
              "description": "The email address that the coopter is reachable",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "String",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "externalId",
              "description": "A unique ID to be used when matching the record against an external system (eg. a LDAP directory)",
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "firstName",
              "description": "The coopter's first name",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "String",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "id",
              "description": null,
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "ID",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "jobTitle",
              "description": "The current job title of the coopter",
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "lastName",
              "description": "The coopter's last name",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "String",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "linkedinUrl",
              "description": "URL of the coopter's linkedin profile",
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "locale",
              "description": "The local to use for the coopter",
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "male",
              "description": "Gender of the coopter (true if the coopter is a man, false if she's a woman)",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "Boolean",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "phone",
              "description": "The coopter's phone number",
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "profileUrl",
              "description": "Other profile URL for the coopter",
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "recommendationsCount",
              "description": "Number of recommendation made by the coopter",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "Int",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "rfm",
              "description": "RFM of the coopter. This field describe if the user logged in recently",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "ENUM",
                  "name": "Rfm",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "segments",
              "description": "List of segment assigned to the coopter",
              "type": {
                "kind": "LIST",
                "name": null,
                "ofType": {
                  "kind": "NON_NULL",
                  "name": null,
                  "ofType": {
                    "kind": "OBJECT",
                    "name": "SegmentGroup",
                    "ofType": null
                  }
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "selfApplicationsCount",
              "description": "Number of self application made by the coopter",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "Int",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "timezone",
              "description": "The timezone to use for the coopter (eg: \"Europe/Paris\", other values can be found in this ([list of time zones](https://www.iana.org/time-zones))",
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            }
          ],
          "inputFields": null,
          "enumValues": null
        },
        {
          "kind": "OBJECT",
          "name": "CoopterConnection",
          "description": "The connection type for Coopter.",
          "interfaces": [

          ],
          "possibleTypes": null,
          "fields": [
            {
              "name": "edges",
              "description": "A list of edges.",
              "type": {
                "kind": "LIST",
                "name": null,
                "ofType": {
                  "kind": "OBJECT",
                  "name": "CoopterEdge",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "nodes",
              "description": "A list of nodes.",
              "type": {
                "kind": "LIST",
                "name": null,
                "ofType": {
                  "kind": "OBJECT",
                  "name": "Coopter",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "pageInfo",
              "description": "Information to aid in pagination.",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "OBJECT",
                  "name": "PageInfo",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            }
          ],
          "inputFields": null,
          "enumValues": null
        },
        {
          "kind": "OBJECT",
          "name": "CoopterEdge",
          "description": "An edge in a connection.",
          "interfaces": [

          ],
          "possibleTypes": null,
          "fields": [
            {
              "name": "cursor",
              "description": "A cursor for use in pagination.",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "String",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "node",
              "description": "The item at the end of the edge.",
              "type": {
                "kind": "OBJECT",
                "name": "Coopter",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            }
          ],
          "inputFields": null,
          "enumValues": null
        },
        {
          "kind": "SCALAR",
          "name": "ID",
          "description": "Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"VXNlci0xMA==\"`) or integer (such as `4`) input value will be accepted as an ID.",
          "interfaces": null,
          "possibleTypes": null,
          "fields": null,
          "inputFields": null,
          "enumValues": null
        },
        {
          "kind": "SCALAR",
          "name": "Int",
          "description": "Represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",
          "interfaces": null,
          "possibleTypes": null,
          "fields": null,
          "inputFields": null,
          "enumValues": null
        },
        {
          "kind": "OBJECT",
          "name": "Mutation",
          "description": null,
          "interfaces": [

          ],
          "possibleTypes": null,
          "fields": [
            {
              "name": "testField",
              "description": "An example field added by the generator",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "String",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            }
          ],
          "inputFields": null,
          "enumValues": null
        },
        {
          "kind": "OBJECT",
          "name": "PageInfo",
          "description": "Information about pagination in a connection.",
          "interfaces": [

          ],
          "possibleTypes": null,
          "fields": [
            {
              "name": "endCursor",
              "description": "When paginating forwards, the cursor to continue.",
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "hasNextPage",
              "description": "When paginating forwards, are there more items?",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "Boolean",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "hasPreviousPage",
              "description": "When paginating backwards, are there more items?",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "Boolean",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "startCursor",
              "description": "When paginating backwards, the cursor to continue.",
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            }
          ],
          "inputFields": null,
          "enumValues": null
        },
        {
          "kind": "OBJECT",
          "name": "Query",
          "description": null,
          "interfaces": [

          ],
          "possibleTypes": null,
          "fields": [
            {
              "name": "coopters",
              "description": null,
              "type": {
                "kind": "OBJECT",
                "name": "CoopterConnection",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [
                {
                  "name": "after",
                  "description": "Returns the elements in the list that come after the specified cursor.",
                  "type": {
                    "kind": "SCALAR",
                    "name": "String",
                    "ofType": null
                  },
                  "defaultValue": null,
                  "isDeprecated": false,
                  "deprecationReason": null
                },
                {
                  "name": "before",
                  "description": "Returns the elements in the list that come before the specified cursor.",
                  "type": {
                    "kind": "SCALAR",
                    "name": "String",
                    "ofType": null
                  },
                  "defaultValue": null,
                  "isDeprecated": false,
                  "deprecationReason": null
                },
                {
                  "name": "first",
                  "description": "Returns the first _n_ elements from the list.",
                  "type": {
                    "kind": "SCALAR",
                    "name": "Int",
                    "ofType": null
                  },
                  "defaultValue": null,
                  "isDeprecated": false,
                  "deprecationReason": null
                },
                {
                  "name": "last",
                  "description": "Returns the last _n_ elements from the list.",
                  "type": {
                    "kind": "SCALAR",
                    "name": "Int",
                    "ofType": null
                  },
                  "defaultValue": null,
                  "isDeprecated": false,
                  "deprecationReason": null
                }
              ]
            }
          ],
          "inputFields": null,
          "enumValues": null
        },
        {
          "kind": "ENUM",
          "name": "Rfm",
          "description": null,
          "interfaces": null,
          "possibleTypes": null,
          "fields": null,
          "inputFields": null,
          "enumValues": [
            {
              "name": "never_logged",
              "description": null,
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "active",
              "description": null,
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "warm",
              "description": null,
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "cold",
              "description": null,
              "isDeprecated": false,
              "deprecationReason": null
            }
          ]
        },
        {
          "kind": "OBJECT",
          "name": "SegmentGroup",
          "description": "Group of segment associated with their key",
          "interfaces": [

          ],
          "possibleTypes": null,
          "fields": [
            {
              "name": "key",
              "description": "Key of the segment",
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "values",
              "description": "List of value for the segments",
              "type": {
                "kind": "LIST",
                "name": null,
                "ofType": {
                  "kind": "NON_NULL",
                  "name": null,
                  "ofType": {
                    "kind": "SCALAR",
                    "name": "String",
                    "ofType": null
                  }
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            }
          ],
          "inputFields": null,
          "enumValues": null
        },
        {
          "kind": "SCALAR",
          "name": "String",
          "description": "Represents textual data as UTF-8 character sequences. This type is most often used by GraphQL to represent free-form human-readable text.",
          "interfaces": null,
          "possibleTypes": null,
          "fields": null,
          "inputFields": null,
          "enumValues": null
        },
        {
          "kind": "OBJECT",
          "name": "__Directive",
          "description": "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",
          "interfaces": [

          ],
          "possibleTypes": null,
          "fields": [
            {
              "name": "args",
              "description": null,
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "LIST",
                  "name": null,
                  "ofType": {
                    "kind": "NON_NULL",
                    "name": null,
                    "ofType": {
                      "kind": "OBJECT",
                      "name": "__InputValue",
                      "ofType": null
                    }
                  }
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [
                {
                  "name": "includeDeprecated",
                  "description": null,
                  "type": {
                    "kind": "SCALAR",
                    "name": "Boolean",
                    "ofType": null
                  },
                  "defaultValue": "false",
                  "isDeprecated": false,
                  "deprecationReason": null
                }
              ]
            },
            {
              "name": "description",
              "description": null,
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "isRepeatable",
              "description": null,
              "type": {
                "kind": "SCALAR",
                "name": "Boolean",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "locations",
              "description": null,
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "LIST",
                  "name": null,
                  "ofType": {
                    "kind": "NON_NULL",
                    "name": null,
                    "ofType": {
                      "kind": "ENUM",
                      "name": "__DirectiveLocation",
                      "ofType": null
                    }
                  }
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "name",
              "description": null,
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "String",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "onField",
              "description": null,
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "Boolean",
                  "ofType": null
                }
              },
              "isDeprecated": true,
              "deprecationReason": "Use `locations`.",
              "args": [

              ]
            },
            {
              "name": "onFragment",
              "description": null,
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "Boolean",
                  "ofType": null
                }
              },
              "isDeprecated": true,
              "deprecationReason": "Use `locations`.",
              "args": [

              ]
            },
            {
              "name": "onOperation",
              "description": null,
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "Boolean",
                  "ofType": null
                }
              },
              "isDeprecated": true,
              "deprecationReason": "Use `locations`.",
              "args": [

              ]
            }
          ],
          "inputFields": null,
          "enumValues": null
        },
        {
          "kind": "ENUM",
          "name": "__DirectiveLocation",
          "description": "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",
          "interfaces": null,
          "possibleTypes": null,
          "fields": null,
          "inputFields": null,
          "enumValues": [
            {
              "name": "QUERY",
              "description": "Location adjacent to a query operation.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "MUTATION",
              "description": "Location adjacent to a mutation operation.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "SUBSCRIPTION",
              "description": "Location adjacent to a subscription operation.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "FIELD",
              "description": "Location adjacent to a field.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "FRAGMENT_DEFINITION",
              "description": "Location adjacent to a fragment definition.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "FRAGMENT_SPREAD",
              "description": "Location adjacent to a fragment spread.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "INLINE_FRAGMENT",
              "description": "Location adjacent to an inline fragment.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "SCHEMA",
              "description": "Location adjacent to a schema definition.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "SCALAR",
              "description": "Location adjacent to a scalar definition.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "OBJECT",
              "description": "Location adjacent to an object type definition.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "FIELD_DEFINITION",
              "description": "Location adjacent to a field definition.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "ARGUMENT_DEFINITION",
              "description": "Location adjacent to an argument definition.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "INTERFACE",
              "description": "Location adjacent to an interface definition.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "UNION",
              "description": "Location adjacent to a union definition.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "ENUM",
              "description": "Location adjacent to an enum definition.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "ENUM_VALUE",
              "description": "Location adjacent to an enum value definition.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "INPUT_OBJECT",
              "description": "Location adjacent to an input object type definition.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "INPUT_FIELD_DEFINITION",
              "description": "Location adjacent to an input object field definition.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "VARIABLE_DEFINITION",
              "description": "Location adjacent to a variable definition.",
              "isDeprecated": false,
              "deprecationReason": null
            }
          ]
        },
        {
          "kind": "OBJECT",
          "name": "__EnumValue",
          "description": "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",
          "interfaces": [

          ],
          "possibleTypes": null,
          "fields": [
            {
              "name": "deprecationReason",
              "description": null,
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "description",
              "description": null,
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "isDeprecated",
              "description": null,
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "Boolean",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "name",
              "description": null,
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "String",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            }
          ],
          "inputFields": null,
          "enumValues": null
        },
        {
          "kind": "OBJECT",
          "name": "__Field",
          "description": "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",
          "interfaces": [

          ],
          "possibleTypes": null,
          "fields": [
            {
              "name": "args",
              "description": null,
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "LIST",
                  "name": null,
                  "ofType": {
                    "kind": "NON_NULL",
                    "name": null,
                    "ofType": {
                      "kind": "OBJECT",
                      "name": "__InputValue",
                      "ofType": null
                    }
                  }
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [
                {
                  "name": "includeDeprecated",
                  "description": null,
                  "type": {
                    "kind": "SCALAR",
                    "name": "Boolean",
                    "ofType": null
                  },
                  "defaultValue": "false",
                  "isDeprecated": false,
                  "deprecationReason": null
                }
              ]
            },
            {
              "name": "deprecationReason",
              "description": null,
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "description",
              "description": null,
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "isDeprecated",
              "description": null,
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "Boolean",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "name",
              "description": null,
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "String",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "type",
              "description": null,
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "OBJECT",
                  "name": "__Type",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            }
          ],
          "inputFields": null,
          "enumValues": null
        },
        {
          "kind": "OBJECT",
          "name": "__InputValue",
          "description": "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",
          "interfaces": [

          ],
          "possibleTypes": null,
          "fields": [
            {
              "name": "defaultValue",
              "description": "A GraphQL-formatted string representing the default value for this input value.",
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "deprecationReason",
              "description": null,
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "description",
              "description": null,
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "isDeprecated",
              "description": null,
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "Boolean",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "name",
              "description": null,
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "String",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "type",
              "description": null,
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "OBJECT",
                  "name": "__Type",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            }
          ],
          "inputFields": null,
          "enumValues": null
        },
        {
          "kind": "OBJECT",
          "name": "__Schema",
          "description": "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",
          "interfaces": [

          ],
          "possibleTypes": null,
          "fields": [
            {
              "name": "description",
              "description": null,
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "directives",
              "description": "A list of all directives supported by this server.",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "LIST",
                  "name": null,
                  "ofType": {
                    "kind": "NON_NULL",
                    "name": null,
                    "ofType": {
                      "kind": "OBJECT",
                      "name": "__Directive",
                      "ofType": null
                    }
                  }
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "mutationType",
              "description": "If this server supports mutation, the type that mutation operations will be rooted at.",
              "type": {
                "kind": "OBJECT",
                "name": "__Type",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "queryType",
              "description": "The type that query operations will be rooted at.",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "OBJECT",
                  "name": "__Type",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "subscriptionType",
              "description": "If this server support subscription, the type that subscription operations will be rooted at.",
              "type": {
                "kind": "OBJECT",
                "name": "__Type",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "types",
              "description": "A list of all types supported by this server.",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "LIST",
                  "name": null,
                  "ofType": {
                    "kind": "NON_NULL",
                    "name": null,
                    "ofType": {
                      "kind": "OBJECT",
                      "name": "__Type",
                      "ofType": null
                    }
                  }
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            }
          ],
          "inputFields": null,
          "enumValues": null
        },
        {
          "kind": "OBJECT",
          "name": "__Type",
          "description": "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",
          "interfaces": [

          ],
          "possibleTypes": null,
          "fields": [
            {
              "name": "description",
              "description": null,
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "enumValues",
              "description": null,
              "type": {
                "kind": "LIST",
                "name": null,
                "ofType": {
                  "kind": "NON_NULL",
                  "name": null,
                  "ofType": {
                    "kind": "OBJECT",
                    "name": "__EnumValue",
                    "ofType": null
                  }
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [
                {
                  "name": "includeDeprecated",
                  "description": null,
                  "type": {
                    "kind": "SCALAR",
                    "name": "Boolean",
                    "ofType": null
                  },
                  "defaultValue": "false",
                  "isDeprecated": false,
                  "deprecationReason": null
                }
              ]
            },
            {
              "name": "fields",
              "description": null,
              "type": {
                "kind": "LIST",
                "name": null,
                "ofType": {
                  "kind": "NON_NULL",
                  "name": null,
                  "ofType": {
                    "kind": "OBJECT",
                    "name": "__Field",
                    "ofType": null
                  }
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [
                {
                  "name": "includeDeprecated",
                  "description": null,
                  "type": {
                    "kind": "SCALAR",
                    "name": "Boolean",
                    "ofType": null
                  },
                  "defaultValue": "false",
                  "isDeprecated": false,
                  "deprecationReason": null
                }
              ]
            },
            {
              "name": "inputFields",
              "description": null,
              "type": {
                "kind": "LIST",
                "name": null,
                "ofType": {
                  "kind": "NON_NULL",
                  "name": null,
                  "ofType": {
                    "kind": "OBJECT",
                    "name": "__InputValue",
                    "ofType": null
                  }
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [
                {
                  "name": "includeDeprecated",
                  "description": null,
                  "type": {
                    "kind": "SCALAR",
                    "name": "Boolean",
                    "ofType": null
                  },
                  "defaultValue": "false",
                  "isDeprecated": false,
                  "deprecationReason": null
                }
              ]
            },
            {
              "name": "interfaces",
              "description": null,
              "type": {
                "kind": "LIST",
                "name": null,
                "ofType": {
                  "kind": "NON_NULL",
                  "name": null,
                  "ofType": {
                    "kind": "OBJECT",
                    "name": "__Type",
                    "ofType": null
                  }
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "isOneOf",
              "description": null,
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "Boolean",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "kind",
              "description": null,
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "ENUM",
                  "name": "__TypeKind",
                  "ofType": null
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "name",
              "description": null,
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "ofType",
              "description": null,
              "type": {
                "kind": "OBJECT",
                "name": "__Type",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "possibleTypes",
              "description": null,
              "type": {
                "kind": "LIST",
                "name": null,
                "ofType": {
                  "kind": "NON_NULL",
                  "name": null,
                  "ofType": {
                    "kind": "OBJECT",
                    "name": "__Type",
                    "ofType": null
                  }
                }
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            },
            {
              "name": "specifiedByURL",
              "description": null,
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "isDeprecated": false,
              "deprecationReason": null,
              "args": [

              ]
            }
          ],
          "inputFields": null,
          "enumValues": null
        },
        {
          "kind": "ENUM",
          "name": "__TypeKind",
          "description": "An enum describing what kind of type a given `__Type` is.",
          "interfaces": null,
          "possibleTypes": null,
          "fields": null,
          "inputFields": null,
          "enumValues": [
            {
              "name": "SCALAR",
              "description": "Indicates this type is a scalar.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "OBJECT",
              "description": "Indicates this type is an object. `fields` and `interfaces` are valid fields.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "INTERFACE",
              "description": "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "UNION",
              "description": "Indicates this type is a union. `possibleTypes` is a valid field.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "ENUM",
              "description": "Indicates this type is an enum. `enumValues` is a valid field.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "INPUT_OBJECT",
              "description": "Indicates this type is an input object. `inputFields` is a valid field.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "LIST",
              "description": "Indicates this type is a list. `ofType` is a valid field.",
              "isDeprecated": false,
              "deprecationReason": null
            },
            {
              "name": "NON_NULL",
              "description": "Indicates this type is a non-null. `ofType` is a valid field.",
              "isDeprecated": false,
              "deprecationReason": null
            }
          ]
        }
      ],
      "directives": [
        {
          "name": "include",
          "description": "Directs the executor to include this field or fragment only when the `if` argument is true.",
          "locations": [
            "FIELD",
            "FRAGMENT_SPREAD",
            "INLINE_FRAGMENT"
          ],
          "args": [
            {
              "name": "if",
              "description": "Included when true.",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "Boolean",
                  "ofType": null
                }
              },
              "defaultValue": null,
              "isDeprecated": false,
              "deprecationReason": null
            }
          ]
        },
        {
          "name": "skip",
          "description": "Directs the executor to skip this field or fragment when the `if` argument is true.",
          "locations": [
            "FIELD",
            "FRAGMENT_SPREAD",
            "INLINE_FRAGMENT"
          ],
          "args": [
            {
              "name": "if",
              "description": "Skipped when true.",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "Boolean",
                  "ofType": null
                }
              },
              "defaultValue": null,
              "isDeprecated": false,
              "deprecationReason": null
            }
          ]
        },
        {
          "name": "deprecated",
          "description": "Marks an element of a GraphQL schema as no longer supported.",
          "locations": [
            "FIELD_DEFINITION",
            "ENUM_VALUE",
            "ARGUMENT_DEFINITION",
            "INPUT_FIELD_DEFINITION"
          ],
          "args": [
            {
              "name": "reason",
              "description": "Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted in [Markdown](https://daringfireball.net/projects/markdown/).",
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "defaultValue": "\"No longer supported\"",
              "isDeprecated": false,
              "deprecationReason": null
            }
          ]
        },
        {
          "name": "oneOf",
          "description": "Requires that exactly one field must be supplied and that field must not be `null`.",
          "locations": [
            "INPUT_OBJECT"
          ],
          "args": [

          ]
        },
        {
          "name": "specifiedBy",
          "description": "Exposes a URL that specifies the behavior of this scalar.",
          "locations": [
            "SCALAR"
          ],
          "args": [
            {
              "name": "url",
              "description": "The URL that specifies the behavior of this scalar.",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "String",
                  "ofType": null
                }
              },
              "defaultValue": null,
              "isDeprecated": false,
              "deprecationReason": null
            }
          ]
        }
      ]
    }
  }
}

CHallenge

Récupérer via l'API REST puis via l'api Graphql

le titre des différentes annonces dont le membre ayant le prénom "BBL" et le nom "GraphQL" a postulé

{
  coopters(firstName: "BBL") {
    nodes {
      lastName
    }
  }
}
query SearchCoopterBBL {
  coopters(firstName: "BBL") {
    nodes {
      lastName
    }
  }
}
query SearchCoopterBBL($firstName) {
  coopters(firstName: $firstName) {
    nodes {
      lastName
    }
  }
}

// Variables

{
  "firstName": "BBL"
}
mutation CreateConsultant {
  createComment(input: {
    attributes: {
      firstName: "Demo"
      lastName: "BBL"
      male: false
      email: "example@example.com"
    }
  }) {
  }
}
mutation CreateConsultant {
  createComment(input: {
    attributes: {
      firstName: "Demo"
      lastName: "BBL"
      male: false
      email: "example@example.com"
    }
  }) {
    errors
    coopter {
     firstName
      lastName
    }
  }
}

GraphQL

By foret_a

GraphQL

  • 49