In this video Emmanuel Henri gives an introduction of what GraphQL is and what it is not and provides some examples to support these statements. He also briefly introduces Apollo, an option for doing GraphQL.
- [Instructor] What is GraphQL, and what are the benefits of using it? Is it a database? No. Is it a server? No. A client? No. So what is it? A couple years ago, Facebook was facing a challenge with their social network. When you're asking for information about friends or friends of their friends' friends, well, the current query options for the database in the market couldn't support. So anytime you would go further than four or five levels deep in your network, Facebook couldn't support it. This is when they created GraphQL.
GraphQL is a query language for any kind of APIs and is able to fulfill any queries across multiple databases. So, in other words, it's not a server or a database. It's a query language. The main benefits of using it is that you can ask for exactly what you want, and you get those results and nothing else. If you followed my TypeScript and Testing and Debugging course, you're familiar with type checking. Well, guess what? GraphQL allows to describe what type of data you can expect.
GraphQL's ecosystem is also in constant growth. Not only you can get started with Facebook's own version of GraphQL, but there are multiple options for you to explore. For example, the Apollo client by the folks at Meteor is built on top of GraphQL and provides several extra features. So needless to say that GraphQL is a great tool to add to your development arsenal. All right, let's move on.
- Basic GraphQL schema
- Object types and fields
- Role of the resolver in GraphQL
- Scalar and enumeration types
- Using GraphQL tools
- Setting up persistence
- Adding new items with mutations
- Updating and deleting items with mutations
- Queries with arguments, aliases, and fragments