-
Notifications
You must be signed in to change notification settings - Fork 1
quick scripts for GRAPHQL mutations and quries
biyingshuai edited this page Jul 5, 2020
·
1 revision
mutation addUser($input: CreateUserInput!) {
addUser(user: $input) {
email
name
password
}
}
variable:
{
"input": {
"email": "[email protected]",
"name": "bys",
"username": "zifeiyu",
"password": "123",
"intro": "this is my intro"
}
}
mutation updateUser($user: UpdateUserInput!) {
update(user: $user) {
name
}
}
variable:
{
"user": {
"id": "5eee0cafb559546b1ad66810",
"name": "bys22222",
"intro": "this is my intro"
}
}
query getUser($id: String!) {
user(id: $id) {
name
email
}
}
variable
{
"id": "5eee22845f58b61575c5c054"
}
mutation addTeam($input: CreateTeamDTO!) {
addTeam(team: $input) {
name,
}
}
variable
{
"input": {
"owner": "5efca6401f1d3a716c7d9533",
"name": "team1"
}
}
mutation addMember($teamId: String!, $member: CreateTeamMemberInput!) {
addMember(teamId: $teamId, member: $member) {
permission,
user
}
}
variable
{
"teamId": "5eef0345c5763dc8a3bc018d",
"member": {
"user": "5eee22845f58b61575c5c054",
"permission": "normal"
}
}
query team($input: String!) {
team(id: $input) {
name
}
}
variable
{
"input": "5eef0345c5763dc8a3bc018d"
}
mutation createSpecification($input: CreateSpecificationDTO!) {
createSpecification(specification: $input) {
id,
name
}
}
variable
{
"input": {
"name": "spec one",
"team": "5efe08c021ae4749a8a14057"
}
}
mutation category($input: CreateCategoryDTO!) {
createCategory(category: $input)
}
variable
{
"input": {
pecificationId": "5f006ce444cbd3120fddf57d",
"name": "颜色"
}
}
mutation updateSpecification($input: UpdateSpecificationDTO!, $fields: [String!]) {
updateSpecification(fields: $fields, specification: $input) {
id,
name
}
}
variable
{
"input": {
"id": "5f006ce444cbd3120fddf57d",
"name": "规范1"
},
"fields": ["id", "name"]
}
mutation updateCategory($input: UpdateCategoryDTO!) {
updateCategory(category: $input)
}
variable
{
"input": {
"id": "5f0143580853d04b011661af",
"name": "字体",
"specificationId": "5f006ce444cbd3120fddf57d"
}
}
mutation deleteCategory($categoryId: String!, $specificationId: String!) {
deleteCategory(categoryId: $categoryId, specificationId: $specificationId)
}
variable
{
"categoryId": "5f0142fa0853d04b011661ae",
"specificationId": "5f006ce444cbd3120fddf57d"
}
query specification($input: String!) {
specification(id: $input) {
id,
name,
team
}
}
variable
{
"input": "5f006ce444cbd3120fddf57d"
}
query category($fields: [String!], $categoryId: String!, $specificationId: String!) {
category(fields: $fields, categoryId: $categoryId, specificationId: $specificationId) {
name
}
}
query specificationItem($names: [String!], $categoryId: String!, $specificationId: String!) {
specificationItem(names: $names, categoryId: $categoryId, specificationId: $specificationId) {
name
}
}
variable
{
"categoryId": "5eef73d17ac1bf330bc74dea",
"specificationId": "5eef37061a98aafcabeef0a3"
}
query level($input: String!) {
level(id: $input) {
id,
name
}
}
variable
{
"input": "5f019229b2ac158fa1c991b5"
}
mutation createLevel($input: CreateLevelDTO!) {
createLevel(level: $input) {
id
}
}
variable
{
"input": {
"specification": "5f006ce444cbd3120fddf57d",
"category": "5f0143580853d04b011661af",
"name": "标题字体"
}
}
mutation createItem($item: CreateItemDTO!, $levelId: String!) {
createItem(item: $item, levelId: $levelId)
}
variable
{
"item": {
"name": "一级标题",
"text": "一级标题title",
"info": "一级标题info",
"meta": "{}"
},
"levelId": "5f019229b2ac158fa1c991b5"
}
query project($input: String!) {
project(id: $input) {
id,
name,
type
}
}
variable
{
"input": "5f01a9f36b333aa78ff86634"
}
mutation createProject($input: CreateProjectDTO!) {
createProject(project: $input) {
id,
name
}
}
variable
{
"input": {
"name": "项目1",
"team": "5efe08c021ae4749a8a14057",
"type": "pc"
}
}
mutation updateProject($input: UpdateProjectDTO!) {
updateProject(project: $input)
}
variable
{
"input": {
"id": "5f01a9f36b333aa78ff86634",
"type": "mobile",
"name": "更新的项目1"
}
}