Skip to content

Commit

Permalink
[core] GraphQL: Fix a bug where the references function wasn't added …
Browse files Browse the repository at this point in the history
…due to strange syntax
  • Loading branch information
saasen committed Feb 27, 2020
1 parent d6a3f6b commit 1366a9a
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions packages/@sanity/core/src/actions/graphql/generateTypeFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,28 +75,19 @@ function createDocumentTypeFilters(documentTypes) {
})
}

function getDocumentFilters(type) {
return (
[
{
fieldName: 'references',
type: 'ID',
description: 'All documents references the given document ID',
constraint: {
comparator: 'REFERENCES'
}
}
],
function getDocumentFilters() {
return [
{
fieldName: 'references',
type: 'ID',
description: 'All documents referencing the given document ID.'
},
{
fieldName: 'is_draft',
type: 'Boolean',
description: 'All documents that are drafts',
constraint: {
field: '_id',
comparator: 'IS_DRAFT'
}
description: 'All documents that are drafts.'
}
)
]
}

module.exports = generateTypeFilters

0 comments on commit 1366a9a

Please sign in to comment.