Andrew Rhyne
04/20/2020, 4:42 PMAndrew Rhyne
04/20/2020, 4:43 PMtgriesser
04/20/2020, 4:44 PMAndrew Rhyne
04/20/2020, 4:45 PMAndrew Rhyne
04/20/2020, 4:45 PMAndrew Rhyne
04/20/2020, 4:45 PMtgriesser
04/20/2020, 4:45 PMtgriesser
04/20/2020, 4:48 PMAndrew Rhyne
04/20/2020, 4:48 PMAndrew Rhyne
04/20/2020, 4:49 PMAndrew Rhyne
04/20/2020, 4:50 PMweakmap
or something like it is being used but perhaps my GC knowledge is a bit rusty at this point hahaAndrew Rhyne
04/20/2020, 4:53 PMbrandon
04/21/2020, 11:18 PMGENERATE_ARTIFACTS=true ts-node --transpile-only src/index
but it doesn’t close the connection. Is there a better way to transpile? I’m using apollo-server-expressbrandon
04/22/2020, 4:03 AMDarryl
04/22/2020, 9:37 AM@nexus/schema
or should I look into transitioning to the Nexus framework? I worry a little as I’ve had a few big refactors with Prisma over the past year with how things have changed and now I’m up-to-date with Prisma 2 (beta 3), I don’t want to settle on a nexus implementation I don’t fully understand and go live with something I’ll have to change down the line.Matt
04/24/2020, 2:36 PMCameron
04/24/2020, 6:26 PMnexus@next
framework (not @nexus/schema
) and graphql-shield
, I’m working on a plugin, that’ll help you. Link coming soon…brandon
04/24/2020, 7:39 PMUser
and Cart
Where it is a 1:1 relationship between the two. How do I do a query similar to t.crud.cart()
if I want it to return the cart of the particular user? Do I have to create a custom resolver or does nexus provide a way to return cart of self within the arguments?brandon
04/24/2020, 7:41 PMt.crud.cart({ WhereUserIdIsInique: User });
or somethingbrandon
04/24/2020, 7:50 PMCameron
04/25/2020, 2:13 AMnexus
. Please let me know your thoughts and how I can improve it 😄
https://github.com/Camji55/nexus-plugin-jwt-authLuc
04/26/2020, 9:54 AMnexus-plugin-shield
a port of graphql-shield
for nexus! Rules and shield configuration are fully compatible.
https://github.com/lvauvillier/nexus-plugin-shieldPaul
04/26/2020, 12:04 PMProperty 'prisma' does not exist on type 'NexusContext'.ts(2339)
?Paul
04/26/2020, 4:42 PM"errors": [{
"message": "..."
"statusCode": "..."
"locations: "..."
}]
is it possible with nexus? any ideas are appreciatedOliver Evans
04/27/2020, 11:24 PM@nexus/schema
to nexus
frameworkOliver Evans
04/27/2020, 11:26 PM% yarn build
yarn run v1.21.1
$ nexus build
877 ● nexus:build getting used plugins
376 ● nexus:plugin:nexus-plugin-prisma Running Prisma generators ...
411 ● nexus:build starting artifact generation
4020 ● nexus:build building typescript program
2822 ● nexus:build starting addToContext type extraction
3 ● nexus:build Awaiting artifact generation & addToContext type extraction
3 ● nexus:build Compiling a production build
Error: node_modules/@types/typegen-nexus/index.d.ts:11:7 - error TS2503: Cannot find namespace 'Prisma'.
11 'db': Prisma.PrismaClient
~~~~~~
at Object.compile (/home/oliver/farmly/microservices/users/node_modules/nexus/dist/lib/tsc.js:63:15)
at Object.buildNexusApp (/home/oliver/farmly/microservices/users/node_modules/nexus/dist/lib/build/build.js:63:11)
at async Build.parse (/home/oliver/farmly/microservices/users/node_modules/nexus/dist/cli/commands/build.js:31:9)
error Command failed with exit code 1.
Oliver Evans
04/27/2020, 11:40 PMOliver Evans
04/28/2020, 9:16 PMAlex Vilchis
04/29/2020, 5:43 PMt.field('count', {
type: 'CountPayload'
});
And then I declared my count payload type as this:
const CountPayload = objectType({
name: 'CountPayload',
definition(t) {
t.field('patient', {
args: {
where: arg({ type: 'PatientWhereInput' })
},
type: 'ModelCount',
resolve: async (parent, args, ctx: Context) => {
const { prisma } = ctx;
return {
count: await prisma.patient.count({ where: args.where })
};
}
});
}
});
const ModelCount = objectType({
name: 'ModelCount',
definition(t) {
<http://t.int|t.int>('count');
}
});
However this is not working ☹️. The count
field in queryType
is returning null. I want the resolve to come from the subfield. Is there a way to achieve this?Alex Vilchis
04/29/2020, 7:36 PM