Skip to content

Commit

Permalink
Add support for graphql@14 (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
flippidippi authored and lorensr committed Jan 22, 2020
1 parent ad65881 commit 9a376db
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ module.exports = function joinMonsterAdapt(schema, jmConfigs) {

function decorateType(type, jmConfig) {
// first get the properties that should be on the type directly
const typeConfig = type._typeConfig
typeConfig.sqlTable = jmConfig.sqlTable
typeConfig.uniqueKey = jmConfig.uniqueKey
type._typeConfig = {}
type._typeConfig.sqlTable = jmConfig.sqlTable
type._typeConfig.uniqueKey = jmConfig.uniqueKey
if (jmConfig.alwaysFetch) {
typeConfig.alwaysFetch = jmConfig.alwaysFetch
type._typeConfig.alwaysFetch = jmConfig.alwaysFetch
}
// These properties may appear for interface types
if (jmConfig.typeHint) {
typeConfig.typeHint = jmConfig.typeHint
type._typeConfig.typeHint = jmConfig.typeHint
}
if (jmConfig.resolveType) {
typeConfig.resolveType = jmConfig.resolveType
type._typeConfig.resolveType = jmConfig.resolveType
}
for (let fieldName in jmConfig.fields) {
const field = type._fields[fieldName]
Expand Down

0 comments on commit 9a376db

Please sign in to comment.