Cauen / prisma-generator-pothos-codegen

The fastest way to create a fully customizable CRUD Graphql API from Prisma Schema.
https://www.npmjs.com/package/prisma-generator-pothos-codegen
95 stars 16 forks source link

Incorrect description escapes when using ' #69

Closed m1212e closed 2 months ago

m1212e commented 4 months ago

When using the ' char in the description of the model as show here:

export const CommitteeMemberObject = definePrismaObject('CommitteeMember', {
  description: 'A user's membership in a committee, providing them with a role in the committee',
  findUnique: ({ id }) => ({ id }),
  fields: (t) => ({
    id: t.field(CommitteeMemberIdFieldObject),
    committee: t.relation('committee', CommitteeMemberCommitteeFieldObject),
    committeeId: t.field(CommitteeMemberCommitteeIdFieldObject),
    user: t.relation('user', CommitteeMemberUserFieldObject),
    userId: t.field(CommitteeMemberUserIdFieldObject),
    speakerLists: t.relation('speakerLists', CommitteeMemberSpeakerListsFieldObject(t)),
    delegation: t.relation('delegation', CommitteeMemberDelegationFieldObject),
    delegationId: t.field(CommitteeMemberDelegationIdFieldObject),
    presence: t.field(CommitteeMemberPresenceFieldObject),
  }),
});

The parsing fails since the string is ended beforehand. Maybe using the template string ` char instead would work?

Cauen commented 2 months ago

Sorry for the delay in responding, busy days D:

Fixed in new version 0.6.5 🗡️ Thanks for helping making this better 🚀