-
Notifications
You must be signed in to change notification settings - Fork 28
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
feat: migrate away from prisma-nexus-plugin. #137
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question on Auth for knowledge sake.
Otherwise looks good.
I'd go ahead and strip v10 in Tests and bump the min required to v12 in this one as well.
Fixed via #135
// List <%= plural %> Query | ||
t.list.field('<%= plural.toLowerCase() %>', { | ||
type: '<%= camelized %>', | ||
authorize: () => false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this defaulting to no authorization needed? or opposite?
If so, should we default a user context as most should/will be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 good call. I'll update. More than anything we just want to ensure to lock down by default with the generators. This is perhaps too locked down 😄
export const StringFilter = inputObjectType({ | ||
name: 'StringFilter', | ||
description: 'A way to filter string fields. Meant to pass to prisma where clause', | ||
definition(t) { | ||
t.string('contains'); | ||
t.string('endsWith'); | ||
t.string('equals'); | ||
t.string('gt'); | ||
t.string('gte'); | ||
t.list.nonNull.string('in'); | ||
t.string('lt'); | ||
t.string('lte'); | ||
t.list.nonNull.string('notIn'); | ||
t.string('startsWith'); | ||
}, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼
t.nonNull.id('id'); | ||
t.nonNull.date('createdAt'); | ||
t.nonNull.date('updatedAt'); | ||
t.nonNull.list.nonNull.field('roles', { type: 'Role' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does nonNull
catch empty arrays?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be equivalent to [Role!]!
which doesn't allow role to return null or any items within the array to be null. It should allow an empty array though.
it("copies prisma/env with the correct contents", async () => { | ||
const target = path.join(targetFolder, "prisma", ".env"); | ||
it("copies env with the correct contents", async () => { | ||
const target = path.join(targetFolder, ".env"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼
* updates generators * removes nexus-prisma-plugin dependency * updates package.json scripts * adds graphql shared module * updates user graphql module * renames and updates seed file
36b57ed
to
9089c05
Compare
This moves to plain Nexus. As a result the graphql modules will take a little more code to wire up, but its less "magical". I've replicated the sorting, ordering, and naming syntax that the plugin used to provide in order to ensure consistency.
The Prisma team is also re-writing this plugin, so I'd rather not depend on it. See graphql-nexus/nexus-plugin-prisma#1039 for more info.
Changes
Screenshots
n/a
Checklist
Fixes #136