@pothos-examples/prisma
TypeScript icon, indicating that this package has built-in type declarations

3.1.15 • Public • Published

A GraphQL API built with prisma

This example uses the following packages:

  • @pothos/core: For building the schema
  • @pothos/plugin-prisma: For prisma based type definitions, and efficient queries
  • @prisma/client: For querying data from a database
  • prisma: For running migrations and generating @prisma/client
  • graphql-yoga: For creating a server that executes the schema

Schema

type Comment {
  author: User!
  comment: String!
  id: ID!
  post: Post!
}

type Post {
  author: User!
  comments: [Comment!]!
  content: String!
  id: ID!
  title: String!
}

type Query {
  post(id: ID!): Post
  posts(skip: Int, take: Int): [Post!]!
  user(id: ID!): User
}

type User {
  comments: [Comment!]!
  firstName: String!
  fullName: String!
  id: ID!
  lastName: String!
  posts: [Post!]!
}

Readme

Keywords

none

Package Sidebar

Install

npm i @pothos-examples/prisma

Weekly Downloads

134

Version

3.1.15

License

none

Unpacked Size

143 kB

Total Files

16

Last publish

Collaborators

  • hayes