apollo-server/docs/source/essentials/queries.md

33 lines
907 B
Markdown
Raw Normal View History

2018-04-05 01:24:56 -04:00
---
2018-04-05 09:53:52 -04:00
title: Queries
2018-04-05 01:24:56 -04:00
description: Turning queries into data
---
2018-04-05 02:31:10 -04:00
## Prerequisites
2018-04-05 02:31:10 -04:00
* A basic understanding of a GraphQL schema ([Schema]())
2018-04-05 02:31:10 -04:00
## Overview
2018-04-05 02:31:10 -04:00
A GraphQL query is for reading data. The schema defines the types of queries which are available to the clients connecting to your server.
## Material
* GraphQL query defines the shape of data that will be returned by a particular request
* This is what an author + books query looks like coming from the client
* make sure it has arguments
2018-04-19 14:51:15 +03:00
* This query is then checked again the server's schema
* looks like this:
* "root" level queries define the main entry points
* Each of those root queries returns a type
**Actually writing resolvers for your queries is found in server/queries**
> TODO: The below headings were left over from the other document. Do we want to remove them?
## Fetching data
## Shaping results
## Linking data sources