Skip to content
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

Question: transform outputs from pal g for SDL first #289

Open
simmons-kyle opened this issue Dec 14, 2022 · 0 comments
Open

Question: transform outputs from pal g for SDL first #289

simmons-kyle opened this issue Dec 14, 2022 · 0 comments

Comments

@simmons-kyle
Copy link

Is it possible to transform the outputs which pal g creates in both the typeDefs and resolvers outputs? For example, our existing setup has resolvers defined in this format in our schema.graphql (using a type named User as an example):

type Query {
   users(first: Int, skip: Int, where: UserWhereInput): [User]!
}
type Mutation {
  createUser(data: UserCreateInput!): User!
  updateUser(data: UserUpdateInput!, where: UserWhereUniqueInput!): User
  deleteUser(where: UserWhereUniqueInput!): User
}

However I noticed that pal g will create these in the format (I know there are other queries that are also generated such as findUniqueUser, findFirstUser, etc. , but just scoping on the specifics for now):

type Query {
  findManyUser(where: UserWhereInput, orderBy: [UserOrderByWithRelationInput], cursor: UserWhereUniqueInput, take: Int, skip: Int, distinct: [UserScalarFieldEnum]): [User!]
}
type Mutation {
  createOneUser(data: UserCreateInput!): User!
  updateOneUser(data: UserUpdateInput!, where: UserWhereUniqueInput!): User!
  deleteOneUser(where: UserWhereUniqueInput!): User
}

Is there any config that I can provide to "transform" the names of the created resolvers - and more importantly the typeDefs - into the formats that fit our current system?

We already have something in place which will handle the execution of the resolvers, the main goal is for us to dynamically generate our schema.graphql on our current schema.prisma files, hence the importance on the typeDefs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant