GraphQL
Table of contents
QraphQL
- StaticQuery
- PageQuery
-
useStaticQuery Hook
- They complete the same task, only the implementation is different.
Simple GraphQL
useStaticQuery Hook
useStaticQuery, graphQL from scratch
Field Alias
-
Using
whatever-name
with:
in front ofsiteMetadata
,whatever-name
will become the alias.query MyQuery { site { info:siteMetadata { title } } }
Query Keyword, Name and Gatsby Clean
-
MyQuery
is the Query Keyword, it requires to be uniquequery MyQuery { site { info:siteMetadata { title } } }
Page Query
- Use plugin: [gatsby-source-filesystem]
allFile - field
- Collection of data