Last active
October 24, 2022 12:30
-
-
Save akkonrad/2c8d84d568c5dcb1455e6656c54fa964 to your computer and use it in GitHub Desktop.
gql/type-defs.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// type-defs.ts | |
import { gql } from 'apollo-server-express'; | |
export const typeDefs = gql` | |
type Person { | |
name: String! | |
born: Int! | |
actedInMovies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) | |
directedMovies: [Movie!]! @relationship(type: "DIRECTED", direction: OUT) | |
} | |
type Movie { | |
title: String! | |
released: Int! | |
actors: [Person!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: IN) | |
director: Person! @relationship(type: "DIRECTED", direction: IN) | |
} | |
interface ActedIn @relationshipProperties { | |
roles: [String!] | |
} | |
extend type Person | |
@auth( | |
rules: [ | |
{ operations: [READ], allowUnauthenticated: true } | |
{ operations: [CREATE, DELETE, UPDATE], isAuthenticated: true } | |
] | |
) | |
`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment