@dialexa/pleco-graphql
Advanced tools
Comparing version 0.1.2 to 0.1.3-alpha.0
import { GraphQLEnumType, GraphQLInputObjectType } from 'graphql'; | ||
export declare const GraphQLFilterQueryBoolean: GraphQLInputObjectType; | ||
export declare const GraphQLFilterQueryFloat: GraphQLInputObjectType; | ||
@@ -3,0 +4,0 @@ export declare const GraphQLFilterQueryID: GraphQLInputObjectType; |
@@ -11,2 +11,6 @@ "use strict"; | ||
const extendedFilterFields = (type) => (Object.assign({}, commonFilterFields(type), { gt: { type }, lt: { type }, gte: { type }, lte: { type } })); | ||
exports.GraphQLFilterQueryBoolean = new graphql_1.GraphQLInputObjectType({ | ||
name: 'FilterQuery_Boolean', | ||
fields: () => (Object.assign({}, commonFilterFields(graphql_1.GraphQLBoolean), { AND: { type: new graphql_1.GraphQLList(exports.GraphQLFilterQueryBoolean) }, OR: { type: new graphql_1.GraphQLList(exports.GraphQLFilterQueryBoolean) } })), | ||
}); | ||
exports.GraphQLFilterQueryFloat = new graphql_1.GraphQLInputObjectType({ | ||
@@ -43,2 +47,3 @@ name: 'FilterQuery_Float', | ||
exports.graphQLTypes = [ | ||
graphql_1.printType(exports.GraphQLFilterQueryBoolean), | ||
graphql_1.printType(exports.GraphQLFilterQueryFloat), | ||
@@ -45,0 +50,0 @@ graphql_1.printType(exports.GraphQLFilterQueryID), |
{ | ||
"name": "@dialexa/pleco-graphql", | ||
"version": "0.1.2", | ||
"version": "0.1.3-alpha.0", | ||
"main": "dist/index.js", | ||
@@ -52,3 +52,3 @@ "typings": "dist/index.d.ts", | ||
}, | ||
"gitHead": "7d4f75cd056067e3648b75d151ce1b0bdf47ddd2" | ||
"gitHead": "57647b94a4e22526d44dea56ad9e229543b0464e" | ||
} |
@@ -1,3 +0,5 @@ | ||
# Pleco - GraphQL | ||
# ![Pleco logo](/assets/logo.svg) | ||
# Pleco GraphQL | ||
## Table of Contents | ||
@@ -20,15 +22,15 @@ - [Overview](#overview) | ||
### Provided Exports | ||
| operation | FilterQuery\_ID | FilterQuery\_String | FilterQuery\_Int | FilterQuery\_Float | | ||
|-----------|-----------------|---------------------|------------------|--------------------| | ||
| AND | ✔ | ✔ | ✔ | ✔ | | ||
| OR | ✔ | ✔ | ✔ | ✔ | | ||
| in | ✔ | ✔ | ✔ | ✔ | | ||
| nin | ✔ | ✔ | ✔ | ✔ | | ||
| eq | ✔ | ✔ | ✔ | ✔ | | ||
| ne | ✔ | ✔ | ✔ | ✔ | | ||
| gt | | ✔ | ✔ | ✔ | | ||
| lt | | ✔ | ✔ | ✔ | | ||
| gte | | ✔ | ✔ | ✔ | | ||
| lte | | ✔ | ✔ | ✔ | | ||
| contains | | ✔ | | | | ||
| operation | FilterQuery\_Boolean | FilterQuery\_ID | FilterQuery\_String | FilterQuery\_Int | FilterQuery\_Float | | ||
|-----------|--------------------- |-----------------|---------------------|------------------|--------------------| | ||
| AND | ✔ | ✔ | ✔ | ✔ | ✔ | | ||
| OR | ✔ | ✔ | ✔ | ✔ | ✔ | | ||
| in | ✔ | ✔ | ✔ | ✔ | ✔ | | ||
| nin | ✔ | ✔ | ✔ | ✔ | ✔ | | ||
| eq | ✔ | ✔ | ✔ | ✔ | ✔ | | ||
| ne | ✔ | ✔ | ✔ | ✔ | ✔ | | ||
| gt | | | ✔ | ✔ | ✔ | | ||
| lt | | | ✔ | ✔ | ✔ | | ||
| gte | | | ✔ | ✔ | ✔ | | ||
| lte | | | ✔ | ✔ | ✔ | | ||
| contains | | | ✔ | | | | ||
@@ -42,10 +44,11 @@ In addition to the 4 `FilterQuery_*` types, pleco-graphql also provides | ||
| SDL Name | Javascript Export | | ||
|---------------------|--------------------------| | ||
| FilterQuery\_ID | GraphQLFilterQueryID | | ||
| FilterQuery\_String | GraphQLFilterQueryString | | ||
| FilterQuery\_Int | GraphQLFilterQueryInt | | ||
| FilterQuery\_Float | GraphQLFilterQueryFloat | | ||
| SortDirection | GraphQLSortDirection | | ||
| LimitOffsetPage | GraphQLLimitOffsetPage | | ||
| SDL Name | Javascript Export | | ||
|----------------------|---------------------------| | ||
| FilterQuery\_Boolean | GraphQLFilterQueryBoolean | | ||
| FilterQuery\_ID | GraphQLFilterQueryID | | ||
| FilterQuery\_String | GraphQLFilterQueryString | | ||
| FilterQuery\_Int | GraphQLFilterQueryInt | | ||
| FilterQuery\_Float | GraphQLFilterQueryFloat | | ||
| SortDirection | GraphQLSortDirection | | ||
| LimitOffsetPage | GraphQLLimitOffsetPage | | ||
@@ -104,2 +107,3 @@ #### Notes | ||
{ "make": { "eq": "nissan" } }, | ||
{ "model": { "in": ["altima", "sentra"] } }, | ||
{ "numberOfUsers": { "AND": [{ "gt": 1000 }, { "lt": 1999 }] } }, | ||
@@ -120,5 +124,9 @@ { | ||
``` | ||
This will specify that the user wants all vehicles whose make is "nissan", who has between 1000-1999 users (exclusive), | ||
This will specify that the user wants all vehicles whose make is "nissan", with model "altima" or "sentry", | ||
who has between 1000-1999 users (exclusive), | ||
whose user survey ratings is greater than or equal to 80.5 | ||
and whose MPG satisifies either highway strictly greater than 30mpg or city greater than or equal to 20mpg, and | ||
sorted by userSurveyRating ascending. | ||
## Known Limitations | ||
- Implicit eq and in are not currently supported because GraphQL does not support union input types yet |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
12977
63
129