Skip to content

Commit

Permalink
fix(settings): connections includes props from core
Browse files Browse the repository at this point in the history
closes #1066
  • Loading branch information
jasonkuhrt committed Jun 17, 2020
1 parent 8480be9 commit 36ab27a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 9 additions & 0 deletions src/runtime/schema/settings.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { cloneDeep } from 'lodash'
import { createSchemaSettingsManager, SchemaSettingsManager } from './settings'

let sm: SchemaSettingsManager
Expand Down Expand Up @@ -25,3 +26,11 @@ it('has defaults', () => {
}
`)
})

describe('connctions', () => {
it('can be changed, preserving the core defaults', () => {
const original = cloneDeep(sm.data)
sm.change({ connections: {} })
expect(sm.data).toEqual(original)
})
})
6 changes: 1 addition & 5 deletions src/runtime/schema/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,7 @@ export function changeSettings(state: SettingsData, newSettings: SettingsInput):
}

if (newSettings.connections) {
// todo deep merge
Object.assign(state.connections, {
...newSettings.connections,
...connectionPluginConfigManagedByNexus,
})
Lo.merge(state.connections, newSettings.connections)
}
}

Expand Down

0 comments on commit 36ab27a

Please sign in to comment.