-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add answers for general FAQ questions #930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6c8749b
0daace0
f639006
5d0b0c8
4ed4004
42d7f00
87b08de
28e29fd
c327ca7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,78 +1,83 @@ | ||
| --- | ||
| title: Frequently Asked Questions (FAQ) | ||
| sidebarTitle: General | ||
| category: FAQ | ||
| layout: FAQLayout | ||
| layout: faq | ||
| category: General | ||
| permalink: /faq/ | ||
| questions: Why should I use GraphQL?,Is GraphQL a database language like SQL?,Does GraphQL replace REST?,How can I learn GraphQL?,Is GraphQL frontend or backend?,Does GraphQL replace Redux or other state management libraries?,Is GraphQL only for React or JavaScript developers?,What is a GraphQL client and why would I use one?,What is the GraphQL Foundation?,How can I contribute to the GraphQL specification? | ||
| --- | ||
|
|
||
| ## Why should I use GraphQL? | ||
|
|
||
| <!-- TODO --> | ||
| It depends on your use case, but in general, GraphQL has a few key features that stand out. For example, GraphQL enables you to: | ||
|
|
||
| * Improve performance and stability by [sending queries](/learn/queries/) for the exact data you need. | ||
| * Aggregate data from [multiple UI components](/learn/queries/#fragments) in [a single request](/learn/best-practices/#server-side-batching-caching ). | ||
| * Create a representation of your data that feels familiar and natural ([a graph](/learn/thinking-in-graphs/#it-s-graphs-all-the-way-down-https-en-wikipedia-org-wiki-turtles-all-the-way-down)). | ||
| * Ensure that all of your data is [statically typed](/learn/schema/) and these types inform [what queries the schema supports](/learn/introspection/). | ||
| * [Reduce the need for breaking changes](/learn/best-practices/#versioning), but utilize a [built-in mechanism for deprecations](https://spec.graphql.org/draft/#sec-Deprecation) when you need to. | ||
| * Examine queries and responses through community tools like [GraphiQL](https://github.com/graphql/graphiql). | ||
|
|
||
| And many others! [Our homepage](/) outlines some more convincing reasons to use GraphQL. | ||
|
|
||
| Additionally, it doesn’t take rewriting your entire application to try out GraphQL. You can even start with a single HTTP request that wraps an existing REST call, for instance. Your [GraphQL schema](/learn/thinking-in-graphs/#shared-language) and [business domain model](/learn/thinking-in-graphs/#business-logic-layer) can be expanded gradually, so we’d recommend focusing on one use case at first and only build the part of the schema you need for that to work. | ||
carolstran marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Soufflé candy lollipop [dragée cake chocolate](). Marzipan lemon drops sweet roll I love cake ice cream muffin chupa chups gummi bears. Ice cream fruitcake I love sweet roll croissant ice cream. Gummi bears sesame snaps cake apple pie cake jelly. Gingerbread powder I love apple pie marzipan jelly beans sugar plum sesame snaps. Tiramisu chupa chups I love bear claw cake. Macaroon muffin topping ice cream bear claw cookie I love marshmallow. Pie gummies toffee candy pastry soufflé. Chupa chups toffee gummi bears I love cake lemon drops. | ||
|
|
||
| ## Is GraphQL a database language like SQL? | ||
carolstran marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| <!-- TODO --> | ||
| No, but this is a common misconception. | ||
|
|
||
| GraphQL is a specification for how to request and modify data. That data can be provided by [arbitrary functions](/learn/) and those functions can call APIs, databases, [local cache](/learn/caching/) or any representation of data. The main and most common use case is calling APIs. | ||
|
|
||
carolstran marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Sugar plum gummies donut cheesecake marshmallow donut caramels. Chocolate cake jelly beans ice cream halvah topping lemon drops liquorice croissant. Jelly-o chocolate gummies chocolate I love toffee danish sweet roll. Marzipan I love I love jujubes cupcake bear claw. Soufflé caramels caramels marzipan icing macaroon. Tootsie roll I love jelly beans halvah sweet donut fruitcake. Icing gummi bears tart marshmallow biscuit candy. Candy canes cotton candy soufflé muffin chocolate cake sweet. Candy canes dragée tiramisu gummies danish gummies gingerbread sugar plum gummies. | ||
| GraphQL is frequently used for database interactions though. For example, it can be built into a wrapper around a database or a [GraphQL server](https://www.howtographql.com/advanced/1-server/) can query various databases. There are also [services](/code/#services) that implement the GraphQL specification and then allow clients to use GraphQL to query that data source. But it can also be used without a database at all. | ||
|
|
||
| For more information on how to get GraphQL to interact with your database, check out our [documentation on resolvers](/learn/execution/#root-fields-resolvers). | ||
|
|
||
| ## Does GraphQL replace REST? | ||
carolstran marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| <!-- TODO --> | ||
| No, not necessarily. They both handle APIs and [serve the same purpose](/learn/thinking-in-graphs/#business-logic-layer) from a business perspective. GraphQL is considered an alternative to REST, but it’s not a definitive replacement. | ||
|
|
||
| Jelly-o cupcake marshmallow marshmallow. Lemon drops cake caramels donut halvah cupcake topping tootsie roll. Jelly cotton candy candy cheesecake danish [jelly-o icing bonbon](). | ||
| GraphQL and REST can actually co-exist in your stack. For example, you can abstract REST APIs behind a [GraphQL server](https://www.howtographql.com/advanced/1-server/). This can be done by masking your REST endpoint into a GraphQL endpoint using [root resolvers](/learn/execution/#root-fields-resolvers). | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would also add that you could do the other way around - generate REST on top of GraphQL so you could gradually move to REST but still support consumers who needs regular REST endpoints. (reference) I've found this to be a very compelling argument when introducing GraphQL to developers for the first time There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree that I think the use case could be good to include. Would you have an idea for somewhere within the docs to link to? We're trying to keep the FAQ neutral and not link to third-party sites. |
||
| ## How can I learn GraphQL? | ||
| For an opinionated perspective on how GraphQL compares to REST, check out [How To GraphQL](https://www.howtographql.com/basics/1-graphql-is-the-better-rest/). | ||
|
|
||
| <!-- TODO --> | ||
| ## How can I learn GraphQL? | ||
carolstran marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| [Gummies lollipop chocolate dragée liquorice.]() Pastry marzipan pie sugar plum halvah topping halvah soufflé marzipan. Biscuit liquorice marshmallow. | ||
| There are many resources available to help you learn GraphQL, including this website. In [our documentation](/learn/), you’ll find a series of articles that explain essential GraphQL concepts and how they work. Our [Community page](/community) is full of resources to reference and groups to join. | ||
|
|
||
| Pie gummies apple pie marzipan halvah cotton candy toffee tootsie roll oat cake. Brownie pudding pastry candy chupa chups liquorice bear claw pudding jujubes. Pie jelly liquorice dessert sweet roll bonbon. Danish macaroon cupcake jelly beans liquorice brownie dessert muffin candy canes. | ||
| For more practical guides, you can visit the [How to GraphQL](https://www.howtographql.com/) fullstack tutorial website. We also have a free online course with edX, [Exploring GraphQL: A Query Language for APIs](https://www.edx.org/course/exploring-graphql-a-query-language-for-apis). | ||
|
|
||
| ## Is GraphQL frontend or backend? | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @IvanGoncharov Should we explain some of the benefits of GraphQL for frontend and backend devs here? I started to but then the answer became long and complex. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with your comment that you could also use GraphQL just for the backend and just for the frontend. The frontend even more in terms of adoption - Most of our larger clients have difficulties (political, technical) for introducing another gateway into their existing stack. |
||
|
|
||
| <!-- TODO --> | ||
|
|
||
| Brownie candy jelly candy wafer cake macaroon I love. Pastry I love jelly beans powder carrot cake wafer chocolate gingerbread soufflé. I love dragée I love macaroon sugar plum topping icing cotton candy. Chupa chups [powder wafer](). | ||
| Neither. Instead, it’s [how you can exchange information between the two](https://www.howtographql.com/basics/3-big-picture/). Both the client and the server should understand and communicate through the GraphQL specification. | ||
|
|
||
| ## Does GraphQL replace Redux or other state management libraries? | ||
|
|
||
| <!-- TODO --> | ||
|
|
||
| Sweet roll candy danish cupcake bonbon biscuit. Jelly-o soufflé chocolate cake fruitcake cookie croissant ice cream tart. | ||
| No, GraphQL isn’t a state management library - but it can reduce the need for one. | ||
|
|
||
| Cupcake soufflé sweet roll cake fruitcake caramels pastry pie. Dragée donut icing pudding ice cream cake cheesecake lemon drops. Apple pie icing tart topping jelly beans sweet marshmallow. Oat cake chocolate lollipop brownie sesame snaps croissant cupcake. Gummies jelly-o chocolate cake chocolate bar. Oat cake sweet powder jelly. | ||
| One benefit of state management libraries like Redux is that they can manipulate API responses into a format that your application understands. With GraphQL, you have control over [what data you request](/learn/queries/#fields) and [how that data is formatted](/learn/execution/). So this benefit is already built-in. Many [client libraries](https://graphql.org/code/#graphql-clients) can also be used to manage state and have features like caching built-in. You may still decide to implement a state management library, but using it to format response data won’t be necessary. | ||
|
|
||
| ## Is GraphQL only for React or JavaScript developers? | ||
carolstran marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| <!-- TODO --> | ||
|
|
||
| Jelly pastry pudding jelly beans candy canes. Carrot cake sesame snaps chocolate cake topping cotton candy sesame snaps cake. Tart cheesecake gummies. Sugar plum apple pie ice cream danish tootsie roll. Chocolate brownie cake lemon drops lemon drops. Brownie chupa chups caramels pastry. Donut bear claw chocolate cake. Candy canes jujubes cake apple pie pudding gummies tootsie roll tootsie roll. [Jujubes cake liquorice.]() Pastry apple pie chocolate icing cake jelly-o. Cookie [cheesecake soufflé]() cake cheesecake tart liquorice. Cake donut jelly beans [bonbon soufflé croissant](). Soufflé tart chocolate cake cake jelly-o dessert. | ||
| No, not at all. [GraphQL services can be written in any language](/learn/schema/#type-language). Our [Code page](/code/) contains a long list of libraries in many different programming languages to help with that. | ||
|
|
||
| Candy danish cupcake topping donut jujubes dragée dessert cotton candy. Sweet roll lollipop tootsie roll gummi bears. Fruitcake powder dessert gummies. Icing I love danish pudding cake. | ||
| It’s understandable why you’d think this, though. GraphQL was introduced at a [React conference](https://www.youtube.com/watch?v=9sc8Pyc51uU) and [GraphQL.js](/graphql-js/) is one of the most widely used reference implementations to date. We know this can be confusing, so we’re working to improve our documentation and add more code samples that aren’t written in JavaScript. | ||
|
|
||
| ## What is a GraphQL client and why would I use one? | ||
|
|
||
| <!-- TODO --> | ||
| GraphQL clients can help you handle [queries, mutations,](/learn/queries/) and [subscriptions](https://spec.graphql.org/draft/#sec-Subscription) to a [GraphQL server](https://www.howtographql.com/advanced/1-server/). This could be done manually, but it would require a lot of work depending on the amount of data you have. By utilizing the underlying structure of a GraphQL API, clients can abstract away some of these tedious processes. Features that can be automated include batching, caching, UI updates, build-time schema validation, and many more. | ||
|
|
||
| Powder powder chocolate cake cookie bear claw. Marshmallow gummi bears sweet roll. Apple pie fruitcake sweet roll tart candy canes chocolate. Gummi bears I love danish halvah tootsie roll sweet roll cupcake tootsie roll dessert. Gummies cake pastry tootsie roll. Carrot cake gingerbread marshmallow I love chocolate. | ||
| You can find a list of GraphQL clients in various languages on our [Code page](/code/#graphql-clients). There’s also an [in-depth explanation of their benefits](https://www.howtographql.com/advanced/0-clients/) on How To GraphQL. | ||
|
|
||
| ## What is the GraphQL Foundation? | ||
|
|
||
| <!-- TODO --> | ||
| It takes more time to implement a GraphQL client upfront, but it becomes worth it the more features you need. You might want to start out [using HTTP requests](/learn/serving-over-http/) as the underlying transport layer (here’s [an example in JavaScript](/graphql-js/graphql-clients/)), then switch to a more intricate client service as your application grows in complexity. | ||
|
|
||
| [Chupa chups gummies I love.]() | ||
| ## What is the GraphQL Foundation? | ||
|
|
||
| Gummies marzipan dessert lemon drops muffin. Chocolate chocolate bar fruitcake toffee powder I love gummies. Donut tart cheesecake. Lollipop sweet roll apple pie I love. Pie candy canes jelly macaroon. Biscuit sugar plum chocolate bar cupcake pudding cake sugar plum bear claw. Cheesecake chocolate I love jelly beans I love tiramisu. Chocolate cake biscuit caramels halvah cotton candy pie. Gingerbread powder candy carrot cake jelly I love. Dessert I love chupa chups caramels lollipop candy canes gingerbread I love gummi bears. | ||
| The [GraphQL Foundation](https://foundation.graphql.org/faq/) provides governance for GraphQL as well as vendor-neutral oversight of funding, events, operations resources, and more. It was formed in 2018 by [various tech companies](https://landscape.graphql.org/category=graph-ql-foundation-member&format=logo-mode) and hosted under the [Linux Foundation](https://www.linuxfoundation.org/). The idea is that it’s an open, neutral home for the GraphQL community. | ||
|
|
||
| Fruitcake lollipop danish cheesecake liquorice cookie cheesecake toffee oat cake. | ||
| You can find out more by visiting [foundation.graphql.org](https://foundation.graphql.org/). | ||
|
|
||
| ## How can I contribute to the GraphQL specification? | ||
|
|
||
| <!-- TODO --> | ||
| GraphQL is still an evolving language and contributions are very welcome! The specification (including the [latest working draft](https://spec.graphql.org/)) is open source and [contributor guidelines](https://github.com/graphql/graphql-spec/blob/master/CONTRIBUTING.md) are available on GitHub. | ||
|
|
||
| Carrot cake tootsie roll ice cream candy canes bonbon. Pudding macaroon I love danish dragée tart biscuit. [Biscuit cake wafer.]() | ||
| There are more ways to get involved with GraphQL beyond the specification though. Updating the content on [this website and the documentation](https://github.com/graphql/graphql.github.io), for example. Or contributing to [graphql-js](https://github.com/graphql/graphql-js), [express-graphql](https://github.com/graphql/express-graphql), [GraphiQL](https://github.com/graphql/graphiql), or [one of the many other projects](https://github.com/graphql/) maintained by the [GraphQL Foundation](#what-is-the-graphql-foundation). | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add a point about schema evolution and that GraphQL not only has a built-in mechanism for deprecations but also greatly reduces the number of situations where you need to do breaking change.
Moreover, GraphQL actually gives you insights into what data is actually used by your clients so even in situations where you need to do breaking change you can effectively communicate it with affected clients.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried to squeeze that all into a bullet point, will be included in the next commit - curious to hear what you think!