|
| 1 | +--- |
| 2 | +title: GraphQL Glossary |
| 3 | +description: A comprehensive list of important GraphQL words and acronyms |
| 4 | +--- |
| 5 | + |
| 6 | + |
| 7 | +We have put together a glossary of words and acronyms that you might hear or come across frequently in GraphQL land. Every developer and GraphQL enthusiast should be able to easily look up a particular term here when referenced in specs, reference guides, READMEs and within a codebase. |
| 8 | + |
| 9 | + |
| 10 | +<h2 id="security">Apollo</h2> |
| 11 | +<p>A set of tools for building GraphQL apps. Some of these tools are Apollo Client (best way to use GraphQL to build Client apps), Apollo Server (for building GraphQL servers), Engine (performance monitoring and tracing), etc.</p> |
| 12 | + |
| 13 | +<h2 id="versioning">Automatic Persisted Queries (APQ) </h2> |
| 14 | +<p> A technique for improving GraphQL network performance by reducing request size over the wire. </p> |
| 15 | + |
| 16 | +<h2 id="monitoring">Argument</h2> |
| 17 | +<p>A parameter or set of key-value pair passed to fields in a schema to filter out results sent back from the server to the client.</p> |
| 18 | + |
| 19 | +<h2 id="performance">Alias</h2> |
| 20 | +<p>An alternative name given to the result of a field to avoid conflicts during data fetching.</p> |
| 21 | + |
| 22 | +<h2 id="file-uploads">Data Source</h2> |
| 23 | +<p>A new utility and pattern for fetching and caching data from REST API endpoints. When layering GraphQL over REST APIs, data sources provides the ability to have a resource cache that saves and shares data easily across multiple GraphQL servers.</p> |
| 24 | + |
| 25 | +```js |
| 26 | +const { RESTDataSource } = require('apollo-datasource-rest'); |
| 27 | + |
| 28 | +class MoviesAPI extends RESTDataSource { |
| 29 | + constructor() { |
| 30 | + super(); |
| 31 | + this.baseURL = 'https://movies-api.example.com/'; |
| 32 | + } |
| 33 | + |
| 34 | + async getMovie(id) { |
| 35 | + return this.get(`movies/${id}`); |
| 36 | + } |
| 37 | + |
| 38 | + async getMostViewedMovies(limit = 10) { |
| 39 | + const data = await this.get('movies', { |
| 40 | + per_page: limit, |
| 41 | + order_by: 'most_viewed', |
| 42 | + }); |
| 43 | + return data.results; |
| 44 | + } |
| 45 | +} |
| 46 | +``` |
| 47 | + |
| 48 | +<h2 id="schema-design">Deferred Query</h2> |
| 49 | +<p>A declaration prefixed with an @ character that encapsulates programming logic for query execution on the client or server. There are built-in such as @skip, @include and custom directives. It can be used for features such as authentication, incremental data loading, etc.</p> |
| 50 | + |
| 51 | +<h2 id="access-control">Docstring</h2> |
| 52 | +<p>A technique for providing metadata to a GraphQL Document. It can used for describing types, fields and arguments.</p> |
| 53 | + |
| 54 | +```js |
| 55 | +""" |
| 56 | +Description for the User |
| 57 | +""" |
| 58 | +type User { |
| 59 | + """ |
| 60 | + Description for first Name |
| 61 | + """ |
| 62 | + firstName: String! |
| 63 | + |
| 64 | + age( |
| 65 | + """ |
| 66 | + Must be an integer |
| 67 | + """ |
| 68 | + arg: Int |
| 69 | + ) |
| 70 | +} |
| 71 | +``` |
| 72 | + |
| 73 | +<h2 id="state-managemnt">Document</h2> |
| 74 | +<p>A file or request string that contains one or multiple definitions of a GraphQL type system and can be interpreted by a GraphQL execution engine.</p> |
| 75 | + |
| 76 | +<h2 id="testing-react-components">Extensions </h2> |
| 77 | +<p></p> |
| 78 | + |
| 79 | + |
| 80 | +<h2 id="state-managemnt">Field</h2> |
| 81 | +<p>A node in a GraphQL Object type that makes up a Schema. It is a unit of data.</p> |
| 82 | + |
| 83 | + |
| 84 | +<h2 id="state-managemnt">Fragment</h2> |
| 85 | +<p>A selection set that can be reused in multiple query operations.</p> |
| 86 | + |
| 87 | +<h2 id="state-managemnt">gql function</h2> |
| 88 | +<p>A JavaScript template literal tag that parses GraphQL queries.</p> |
| 89 | + |
| 90 | +```js |
| 91 | +const typeDefs = gql` |
| 92 | + type File { |
| 93 | + filename: String! |
| 94 | + mimetype: String! |
| 95 | + encoding: String! |
| 96 | + } |
| 97 | +`; |
| 98 | +``` |
| 99 | + |
| 100 | +<h2 id="state-managemnt">GraphQL Playground</h2> |
| 101 | +<p>An in-browser IDE for GraphQL development and workflow. Added benefits exist such as theme change, automatic schema reloading, HTTP headers configuration, query history and GraphQL subscription support.</p> |
| 102 | + |
| 103 | +<h2 id="state-managemnt">GraphiQL</h2> |
| 104 | +<p>An in-browser IDE for GraphQL development. The first-ever GraphQL IDE released by Facebook.</p> |
| 105 | + |
| 106 | +<h2 id="state-managemnt">Introspection</h2> |
| 107 | +<p>A technique to provide detailed information about a GraphQL API's schema. Types and fields used in introspection are prefixed with "__" two underscores.</p> |
| 108 | + |
| 109 | +<h2 id="state-managemnt">Mutation</h2> |
| 110 | +<p>An operation for creating, modifying and destroying data. A fetch operation happens immediately after the write.</p> |
| 111 | + |
| 112 | +<h2 id="state-managemnt">Normalization</h2> |
| 113 | +<p>A technique for transforming default GraphQL responses into a specific desired format.</p> |
| 114 | + |
| 115 | +```js |
| 116 | +// Example of a default GraphQL response |
| 117 | +const response = { |
| 118 | + data: { |
| 119 | + getUser: { |
| 120 | + __typename: 'User', |
| 121 | + uid: '5a6efb94b0e8c36f99fba013', |
| 122 | + email: 'john.doe@yahoo.com', |
| 123 | + }, |
| 124 | + }, |
| 125 | +} |
| 126 | + |
| 127 | +// After Normalization |
| 128 | +{ |
| 129 | + users: { |
| 130 | + '5a6efb94b0e8c36f99fba013': { |
| 131 | + uid: '5a6efb94b0e8c36f99fba013', |
| 132 | + email: 'john.doe@yahoo.com' |
| 133 | + } |
| 134 | + } |
| 135 | +} |
| 136 | +``` |
| 137 | + |
| 138 | +<h2 id="state-managemnt">Object Type</h2> |
| 139 | +<p>A form of Object with a type specifier that has fields that can fetch data from an API service, e.g User is an Object type.</p> |
| 140 | + |
| 141 | +```js |
| 142 | +type User { |
| 143 | + name: String!, |
| 144 | +} |
| 145 | +``` |
| 146 | + |
| 147 | +<h2 id="state-managemnt">Operation</h2> |
| 148 | +<p>A single query, mutation, or subscription that can be interpreted by a GraphQL execution engine.</p> |
| 149 | + |
| 150 | +<h2 id="state-managemnt">Operation name</h2> |
| 151 | +<p>A name for a single query, mutation, or subscription. Identifying a query or mutation by name is very useful for logging and debugging when something goes wrong in a GraphQL server.</p> |
| 152 | + |
| 153 | +<h2 id="state-managemnt">Partial query caching</h2> |
| 154 | +<p>A technique for caching GraphQL query inputs. This type of caching can be done in Apollo Server 2.0 with an option to configure whatever cache store is convenient for your app.</p> |
| 155 | + |
| 156 | +<h2 id="state-managemnt">Query</h2> |
| 157 | +<p>An operation that makes a GET request to a GraphQL service requesting for some data. It's better known as a read-only fetch operation.</p> |
| 158 | + |
| 159 | +<h2 id="state-managemnt">Query colocation</h2> |
| 160 | +<p>A practice of placing a GraphQL query in the same location as the app component's view logic.</p> |
| 161 | + |
| 162 | +```js |
| 163 | +const GET_DOG_PHOTO = gql` |
| 164 | + query dog($breed: String!) { |
| 165 | + dog(breed: $breed) { |
| 166 | + id |
| 167 | + displayImage |
| 168 | + } |
| 169 | +}`; |
| 170 | + |
| 171 | +export const queryComponent = `const DogPhoto = ({ breed }) => ( |
| 172 | + <Query query={GET_DOG_PHOTO} variables={{ breed }}> |
| 173 | + {({ loading, error, data }) => { |
| 174 | + if (loading) return null; |
| 175 | + if (error) return 'Error!'; |
| 176 | + return ( |
| 177 | + <img src={data.dog.displayImage} /> |
| 178 | + ); |
| 179 | + }} |
| 180 | + </Query> |
| 181 | +);`; |
| 182 | +``` |
| 183 | + |
| 184 | +<h2 id="state-managemnt">Query whitelisting</h2> |
| 185 | +<p>A technique for preventing unwanted attacks by maintaining a list of approved queries that are allowed in your application. Any query not present in the list that is run against the server will not be allowed. [Automatic Persisted Queries](../guides/performance.html#automatic-persisted-queries) is a tool by Apollo that enables query whitelisting and persisted queries.</p> |
| 186 | + |
| 187 | +<h2 id="state-managemnt">Resolver</h2> |
| 188 | +<p>A function that connects schema fields and types to various backends. It can retrieve or write data from either an SQL, a No-SQL, graph database, a micro-service or a REST API.</p> |
| 189 | + |
| 190 | + |
| 191 | +<h2 id="state-managemnt">Schema</h2> |
| 192 | +<p>A model of the data that can be fetched from or written to a GraphQL server.</p> |
| 193 | + |
| 194 | + |
| 195 | +<h2 id="state-managemnt">Schema Definition Language (SDL)</h2> |
| 196 | +<p>The syntax for writing GraphQL Schemas. It is otherwise known as Interface Definition Language. It is the lingua franca shared by all for building GraphQL APIs regardless of the programming language chosen.</p> |
| 197 | + |
| 198 | + |
| 199 | +<h2 id="state-managemnt">Schema first development</h2> |
| 200 | +<p>A development approach for designing and building modern UIs that involves the frontend and backend teams agreeing on a Schema first, which serves as a contract between the UI and the backend before any API engineering happens.</p> |
| 201 | + |
| 202 | + |
| 203 | +<h2 id="state-managemnt">Schema registry</h2> |
| 204 | +<p>A central database that enables schema registration, tracking of detailed schema changes e.g. types added, fields added, fields deprecated and checking out previous versions of schema.</p> |
| 205 | + |
| 206 | + |
| 207 | +<h2 id="state-managemnt">Schema versioning</h2> |
| 208 | +<p>Refers to the ability to have different versions of your Schema. This allows for reversible changes to be made to the Schema. The Apollo CLI is a tool that provides and manages Schema versioning with Engine.</p> |
| 209 | + |
| 210 | + |
| 211 | +<h2 id="state-managemnt">Schema stitching</h2> |
| 212 | +<p>The process of merging [different schemas into one GraphQL schema](./docs/graphql-tools/schema-stitching.html). These schemas can be local, remote or from third party services.</p> |
| 213 | + |
| 214 | + |
| 215 | +<h2 id="state-managemnt">Subscription</h2> |
| 216 | +<p>A real-time GraphQL operation. A Subscription is defined in a schema like queries and mutations.</p> |
| 217 | + |
| 218 | +```js |
| 219 | +type Subscription { |
| 220 | + commentAdded(repoFullName: String!): Comment |
| 221 | +} |
| 222 | +... |
| 223 | +subscription onCommentAdded($repoFullName: String!){ |
| 224 | + commentAdded(repoFullName: $repoFullName){ |
| 225 | + id |
| 226 | + content |
| 227 | + } |
| 228 | +} |
| 229 | +``` |
| 230 | + |
| 231 | +<h2 id="state-managemnt">Scalar Type</h2> |
| 232 | +<p>A type that qualifies the data a GraphQL field resolves. GraphQL ships with some scalar types out of the box; **Int**, **Float**, **String**, **Boolean** and **ID**. However, a custom scalar type such as **Date** can be specified in a GraphQL service implementation.</p> |
| 233 | + |
| 234 | + |
| 235 | +<h2 id="state-managemnt">Type System</h2> |
| 236 | +<p>A collection of types which characterizes the set of data that can be validated, queried and executed on a GraphQL API.</p> |
| 237 | + |
| 238 | + |
| 239 | +<h2 id="state-managemnt">Whole response caching</h2> |
| 240 | +<p>A technique used to cache an entire GraphQL result of a query operation. This process improves performance by preventing the fetching of the same results from the server if it has been obtained before. Check out the [Apollo performance guide on how to implement this type of caching](../guides/performance.html).</p> |
0 commit comments