@pothos-examples/graphql-shield
v3.1.2
Published
This example shows how you can create a simple plugin to apply graphql shield rules to your schema
Downloads
78
Readme
A Simple Pothos API with a custom graphql-shield plugin
This example shows how you can create a simple plugin to apply graphql shield rules to your schema
This example uses the following packages:
@pothos/core
: For building the schemagraphql-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!]!
}