You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm connecting to two different DBs and have created two different makeSchema() which I use mergeSchema to combine.
This all works fine, however I can't build as Typescript is not loading the types for the second instance of schema. Here's an example of one of the index files::
import { nexusPrisma } from 'nexus-plugin-prisma'
import { makeSchema, connectionPlugin, declarativeWrappingPlugin } from 'nexus'
import {
transformSchema,
FilterObjectFields
} from 'graphql-tools'
import * as path from 'path'
import Query from './Query'
import Mutation from './Mutation'
import * as enums from './enum'
import * as types from './types'
import { blacklistedTypeFields } from '../../utils/blacklistedTypeFields'
import { nullGuardPlugin } from '../plugins/nullabilityGuard'
const DEBUGGING_CURSOR = false
// Part of Relay connection implementation
let fn = DEBUGGING_CURSOR ? (i: string) => i : undefined
const schema = makeSchema({
types: [
types, Query, enums, Mutation
],
contextType: { module: path.join(__dirname, '../../utils/types'), export: "Context"},
plugins: [
declarativeWrappingPlugin(),
connectionPlugin({
encodeCursor: fn,
decodeCursor: fn
}),
nullGuardPlugin,
nexusPrisma({
experimentalCRUD: true,
prismaClient: (ctx) => ctx.users,
computedInputs: {
login: (data) => data.ctx.login
},
inputs: { prismaClient: path.join(__dirname, '../../generated/prisma/users/client') },
outputs: { typegen: path.join(__dirname, '../../generated/nexus/users/index.ts') },
})
],
outputs: {
schema: path.join(__dirname, '../../generated/nexus/users/schema.graphql'),
typegen: path.join(__dirname, '../../generated/nexus/users/nexus.ts')
}
})
// Transform schema to filter out certain fields from types for security purposes
const transformedSchema = transformSchema(schema, [
new FilterObjectFields(
(_typeName, fieldName) =>
!blacklistedTypeFields.includes(fieldName as string)
)
])
export { transformedSchema as default }
The text was updated successfully, but these errors were encountered:
I'm connecting to two different DBs and have created two different makeSchema() which I use mergeSchema to combine.
This all works fine, however I can't build as Typescript is not loading the types for the second instance of schema. Here's an example of one of the index files::
The text was updated successfully, but these errors were encountered: