Skip to content

Commit

Permalink
Merge pull request #1452 from gatsbyjs/master
Browse files Browse the repository at this point in the history
update repo
  • Loading branch information
muescha authored Aug 11, 2020
2 parents 418104e + fd2194f commit dc5562c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
12 changes: 9 additions & 3 deletions dictionary.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
0BSD
½
0BSD
1000px
1000s
1000x
Expand Down Expand Up @@ -244,6 +244,7 @@ bois
Bolda
Bölüm
bool
booleans
bootcamp
bootcamps
bootstrapable
Expand Down Expand Up @@ -388,6 +389,9 @@ Commento
Commentors
CommonJS
CommonMark
comparator
Comparator
comparators
compile-to-js
componentChunkName
componentChunkNames
Expand Down Expand Up @@ -429,8 +433,8 @@ Costa
Costea
Coughlan
counterintuitive
COVID-19
COVID
COVID-19
cowpaths
Coyier
CPG
Expand Down Expand Up @@ -665,6 +669,7 @@ filesystem-based
filesystem-explorer-options
filesystem-query
Fillerama
filterValue
FindCollabs
findDirtyIds
findIdsWithoutDataDependencies
Expand Down Expand Up @@ -1254,6 +1259,7 @@ METROGLAM
Meuleman
Michał
Microfrontends
micromatch
microservices
microsites
middleware
Expand Down Expand Up @@ -1332,11 +1338,11 @@ Nicky
Nie
Nik
no-brainer
Node.js
nodeId
nodeID
NodeID
nodemailer
Node.js
NodeSchool
nodesPromise
Nolen
Expand Down
10 changes: 4 additions & 6 deletions docs/docs/query-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ title: Query Filters with GraphQL in Gatsby
## Summary

Gatsby stores all data loaded during the source-nodes phase in Redux and it allows you to write GraphQL queries to query that data. This data, stored as individual "nodes", can be searched through using a query language that is inspired by [MongoDb queries](https://docs.mongodb.com/manual/reference/operator/query/).
Gatsby stores all data loaded during the source-nodes phase in Redux and it allows you to write GraphQL queries to query that data. This data, stored as individual "nodes", can be searched through using a query language that is inspired by [MongoDB queries](https://docs.mongodb.com/manual/reference/operator/query/).

Filtering is used in GraphQL root fields of Node types (e.g. for File type it would be `file` and `allFile`). `filter` GraphQL argument is passed to the filtering system and will return all the nodes that match each of the given filters. The resto of the processing, such as pagination, is handled on GraphQL resolver level.

Filtering is used in GraphQL root fields of Node types (e.g. for File type it would be `file` and `allFile`). The GraphQL `filter` argument is passed to the filtering system and will return all the nodes that match each of the given filters. The rest of the processing, such as pagination, is handled on GraphQL resolver level.
Filtering is used in GraphQL root fields of Node types (e.g. for File type it would be `file` and `allFile`). The GraphQL `filter` argument is passed to the filtering system and will return all the nodes that match each of the given filters. The rest of the processing, such as pagination, is handled on the GraphQL resolver level.

### History and Sift

For a long time Gatsby used the [sift.js](https://github.com/crcn/sift.js) library through which you can use [MongoDb queries](https://docs.mongodb.com/manual/reference/operator/query/) in JavaScript.
For a long time Gatsby used the [sift.js](https://github.com/crcn/sift.js) library through which you can use [MongoDB queries](https://docs.mongodb.com/manual/reference/operator/query/) in JavaScript.

Unfortunately Sift did not align with how Gatsby used it and so a custom system was written to slowly replace it. This system was called "fast filters" and as of gatsby@2.23.0 (June 2020) the Sift library is no longer used.

Expand Down Expand Up @@ -137,7 +135,7 @@ Specific rules:
- Glob pattern is converted to a JavaScript RegExp with [micromatch](https://github.com/micromatch/micromatch)
- The `regex` filterValue must be a stringified regular expression, including leading and trailing forward slash and optional flags; Like `"/foo/g"`
- Never returns nodes with partial paths
- While testing, result values are explicitly casted to a string through `String(resultValue)` before passing it to `regex.test()`
- While testing, result values are explicitly cast to a string through `String(resultValue)` before passing it to `regex.test()`
### Nulls and partial paths
Expand Down

0 comments on commit dc5562c

Please sign in to comment.