Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hack to get GraphQL 14 to work #15

Merged
merged 1 commit into from
Jan 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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