Skip to content

Commit

Permalink
Merge branch 'master' into greenkeeper/sqlite3-4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy authored Jul 4, 2018
2 parents 71b7e51 + 9b155ea commit e3a479e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Function for generating a `JOIN` condition.
<a name="thunk"></a>

## thunk : <code>function</code>
Rather than a constant value, its a function to dynamically return the value.
Rather than a constant value, it's a function to dynamically return the value.


| Param | Type | Description |
Expand Down
4 changes: 2 additions & 2 deletions docs/field-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const User = new GraphQLObjectType({
},
email: {
type: GraphQLString,
// if the column name is different, it must be specified specified
// if the column name is different, it must be specified
sqlColumn: 'email_address'
},
idEncoded: {
Expand All @@ -21,7 +21,7 @@ const User = new GraphQLObjectType({
sqlColumn: 'id',
// this field uses a sqlColumn and applies a resolver function on the value
// if a resolver is present, the `sqlColumn` MUST be specified even if it is the same name as the field
resolve: user => toBase64(user.idEncoded)
resolve: user => toBase64(user.id)
}
})
})
Expand Down
2 changes: 1 addition & 1 deletion docs/many-to-many.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const User = new GraphQLObjectType({
//...
following: {
type: new GraphQLList(User),
// only get followers who's account is still active
// only get followees who's account is still active
where: accountTable => `${accountTable}.is_active = TRUE`,
junction: {
sqlTable: 'relationships',
Expand Down
2 changes: 1 addition & 1 deletion docs/where.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const QueryRoot = new GraphQLObjectType({
## Adding Context

Most often, we'll be asking for the *logged-in* user.
The `joinMonster` function has a second parameter which is basically an arbitrary object with useful contextual information that your `where` functions might depend on.
The `joinMonster` function has a third parameter which is basically an arbitrary object with useful contextual information that your `where` functions might depend on.
For example, you can pass in the ID of the logged in user to incorporate it into the `WHERE` condition.

```javascript
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"graphql": "0.6 || 0.7 || 0.8 || 0.9 || 0.10 || 0.11 || 0.12"
},
"devDependencies": {
"ava": "^0.23.0",
"ava": "^0.25.0",
"babel-cli": "^6.14.0",
"babel-eslint": "^8.0.0",
"babel-plugin-idx": "^1.5.1",
Expand All @@ -83,20 +83,20 @@
"eslint": "^4.7.1",
"eslint-config-airbnb-base": "^12.0.0",
"faker": "^4.1.0",
"graphql": "^0.12.3",
"graphsiql": "0.1.0",
"jsdoc-to-markdown": "^3.0.0",
"graphql": "^0.13.0",
"graphsiql": "0.2.0",
"jsdoc-to-markdown": "^4.0.0",
"kcors": "^2.2.1",
"knex": "^0.14.0",
"koa": "^2.0.1",
"koa-custom-graphiql": "1.0.1",
"koa-graphql": "^0.7.0",
"koa-router": "^7.1.1",
"koa-static": "^3.0.0",
"koa-static": "^4.0.2",
"mysql": "^2.14.1",
"nyc": "^11.1.0",
"nyc": "^12.0.1",
"pg": "^7.1.0",
"sinon": "^4.0.0",
"sinon": "^5.0.0",
"sqlite3": "^4.0.0"
},
"dependencies": {
Expand Down
7 changes: 3 additions & 4 deletions src/query-ast-to-sql-ast/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,9 @@ export function queryASTToSqlAST(resolveInfo, options, context) {
const parentType = resolveInfo.parentType
populateASTNode.call(resolveInfo, queryAST, parentType, sqlAST, namespace, 0, options, context)

// make sure they started this party on a table
assert.equal(
sqlAST.type,
'table',
// make sure they started this party on a table, interface or union.
assert.ok(
[ 'table', 'union' ].indexOf(sqlAST.type) > -1,
'Must call joinMonster in a resolver on a field where the type is decorated with "sqlTable".'
)

Expand Down

0 comments on commit e3a479e

Please sign in to comment.