I am so sad because the apollo server schema syste...
# orm-help
d
I am so sad because the apollo server schema system can’t use typescript’s type which prisma creates.
Copy code
const usersWithArgs = Prisma.validator<Prisma.UserArgs>()({
  include: {
    _count: {
      select: {
        followers: true,
        followings: true,
      },
    },
  },
});

type UsersWithArgs = Prisma.UserGetPayload<typeof usersWithArgs>[];

export const QueryTypeDefs = gql`
  type Query {
    users: [User]! # Wanna use type UsersWithArgs in Here
}
Currently thinking about Jsonifying types and use it in typedefs…
c
You can use mappers to tell GraphQL Codegen to use Prisma types for your Apollo resolvers https://the-guild.dev/blog/better-type-safety-for-resolvers-with-graphql-codegen.
I'm learning TypeScript and GraphQL so still wrapping my head around this 😅