Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
Triz_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
sdy
2020-08-30 23:37:46 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
18d6965990553439eab33c321e1341818b510bad
18d69659
1 parent
4904cb31
remove unnecessary files
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
0 additions
and
74 deletions
back/src/api/Category/Category.js
back/src/api/Category/addCategory/addCategory.graphql
back/src/api/Category/addCategory/addCategory.js
back/src/api/Category/deleteCategory/deleteCategory.graphql
back/src/api/Category/deleteCategory/deleteCategory.js
back/src/api/Category/getCategories/getCategories.graphql
back/src/api/Category/getCategories/getCategories.js
back/src/api/Category/subCategory/subCategory.graphql
back/src/api/Category/subCategory/subCategory.js
back/src/api/Category/Category.js
deleted
100644 → 0
View file @
4904cb3
import
{
prisma
}
from
"../../utils"
;
export
default
{
Category
:
{
messages
:
(
parent
)
=>
prisma
.
category
.
findOne
({
where
:
{
id
:
parent
.
id
}
}).
messages
(),
},
};
back/src/api/Category/addCategory/addCategory.graphql
deleted
100644 → 0
View file @
4904cb3
type Mutation {
addCategory(name: String): Category!
}
back/src/api/Category/addCategory/addCategory.js
deleted
100644 → 0
View file @
4904cb3
import
{
prisma
,
isAuthenticated
}
from
"../../../utils"
;
import
{
NEW_CATEGORY
}
from
"../../../topics"
;
export
default
{
Mutation
:
{
addCategory
:
async
(
_
,
args
,
{
request
,
pubsub
})
=>
{
isAuthenticated
(
request
);
const
{
name
}
=
args
;
const
newCategory
=
await
prisma
.
category
.
create
({
data
:
{
name
,
},
});
if
(
newCategory
!==
undefined
)
{
pubsub
.
publish
(
NEW_CATEGORY
,
{
subCategory
:
newCategory
});
}
return
newCategory
;
},
},
};
back/src/api/Category/deleteCategory/deleteCategory.graphql
deleted
100644 → 0
View file @
4904cb3
type Mutation {
deleteCategory(name: String!): Boolean!
}
back/src/api/Category/deleteCategory/deleteCategory.js
deleted
100644 → 0
View file @
4904cb3
import
{
prisma
}
from
"../../../utils"
;
export
default
{
Mutation
:
{
deleteCategory
:
async
(
_
,
args
)
=>
{
const
{
name
}
=
args
;
return
prisma
.
category
.
delete
({
where
:
{
name
,
},
});
},
},
};
back/src/api/Category/getCategories/getCategories.graphql
deleted
100644 → 0
View file @
4904cb3
type Query {
getCategories: [Category]
}
back/src/api/Category/getCategories/getCategories.js
deleted
100644 → 0
View file @
4904cb3
import
{
prisma
}
from
"../../../utils"
;
export
default
{
Query
:
{
getCategories
:
async
(
_
,
__
)
=>
{
return
prisma
.
category
.
findMany
();
},
},
};
back/src/api/Category/subCategory/subCategory.graphql
deleted
100644 → 0
View file @
4904cb3
type Subscription {
subCategory: Category
}
back/src/api/Category/subCategory/subCategory.js
deleted
100644 → 0
View file @
4904cb3
import
{
NEW_CATEGORY
}
from
"../../../topics"
;
export
default
{
Subscription
:
{
subCategory
:
{
subscribe
:
async
(
_
,
__
,
{
pubsub
})
=>
{
return
pubsub
.
asyncIterator
(
NEW_CATEGORY
);
},
},
},
};
Please
register
or
login
to post a comment