-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
27 additions
and
48 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,36 @@ | ||
const { buildSchema } = require('graphql'); | ||
|
||
module.exports = buildSchema(` | ||
type TestData { | ||
text: String! | ||
views: Int! | ||
type Post { | ||
_id: ID! | ||
title: String! | ||
content: String! | ||
imageUrl: String! | ||
creator: User! | ||
createdAt: String! | ||
updatedAt: String! | ||
} | ||
This comment has been minimized.
Sorry, something went wrong. |
||
type RootQuery { | ||
hello: TestData! | ||
type User { | ||
_id: ID! | ||
name: String! | ||
email: String! | ||
password: String | ||
status: String! | ||
posts: [Post!]! | ||
} | ||
input UserData { | ||
This comment has been minimized.
Sorry, something went wrong. |
||
email: String! | ||
name: String! | ||
password: String! | ||
} | ||
type RootMutation { | ||
createUser(userInput: UserData): User | ||
} | ||
This comment has been minimized.
Sorry, something went wrong.
leo41271
Author
Owner
|
||
schema { | ||
query: RootQuery | ||
mutation: RootMutation | ||
} | ||
`); |
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
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
_id: ID!
ID 內建提供的 視為 id