47 lines
561 B
GraphQL
47 lines
561 B
GraphQL
# Complex GraphQL schema with multiple features
|
|
|
|
scalar DateTime
|
|
scalar JSON
|
|
scalar Date
|
|
|
|
enum Role {
|
|
USER
|
|
ADMIN
|
|
MODERATOR
|
|
}
|
|
|
|
type User {
|
|
id: ID!
|
|
email: String!
|
|
name: String!
|
|
role: Role!
|
|
createdAt: DateTime!
|
|
posts: [Post!]!
|
|
profile: Profile
|
|
}
|
|
|
|
type Profile {
|
|
id: ID!
|
|
bio: String
|
|
avatar: String
|
|
metadata: JSON
|
|
user: User!
|
|
}
|
|
|
|
type Post {
|
|
id: ID!
|
|
title: String!
|
|
slug: String!
|
|
content: String
|
|
published: Boolean!
|
|
publishedAt: Date
|
|
author: User!
|
|
tags: [Tag!]!
|
|
}
|
|
|
|
type Tag {
|
|
id: ID!
|
|
name: String!
|
|
posts: [Post!]!
|
|
}
|