@pothos-examples/prisma-smart-subscriptions-apollo v3.1.7
A GraphQL API built with prisma with subscriptions for basic CRUD mutations
This example uses the following packages:
@pothos/core
: For building the schema@pothos/plugin-prisma
: For prisma based type definitions, and efficient queries@pothos/plugin-smart-subscriptions
: For automatically create subscription from db query@prisma/client
: For querying data from a databaseprisma
: For running migrations and generating@prisma/client
@apollo/server
: For creating a server that executes the schemaexpress
: Mandatory for Apollo v4 subscriptions
This is a fairly basic implementation, and may not represent best practices for production, but should help demonstrate how smart subscriptions could be implemented.
Schema
type Comment {
author: User!
comment: String!
id: ID!
post: Post!
}
type Mutation {
createOneUser(firstName: String!, lastName: String!): User!
}
type Post {
author: User!
comments: [Comment!]!
content: String!
id: ID!
title: String!
}
type Query {
countManyUser: Int!
}
type Subscription {
countManyUser: Int!
}
type User {
comments: [Comment!]!
firstName: String!
fullName: String!
id: ID!
lastName: String!
posts: [Post!]!
}
4 days ago
12 days ago
14 days ago
14 days ago
28 days ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
4 months ago
4 months ago
4 months ago
3 months ago
4 months ago
4 months ago
3 months ago
3 months ago
3 months ago
6 months ago
7 months ago
8 months ago
9 months ago
9 months ago
10 months ago
11 months ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago