-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat Create session functionality & design
- Loading branch information
Showing
3 changed files
with
233 additions
and
46 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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { gql } from '@apollo/client'; | ||
|
||
// Query to get a single session by ID | ||
export const GET_SESSION = gql` | ||
query GetSession($ID: ID!) { | ||
getSession(id: $ID) { | ||
id | ||
Sessionname | ||
description | ||
platform | ||
duration | ||
organizer | ||
} | ||
} | ||
`; | ||
|
||
// Query to get a list of all sessions | ||
export const GET_SESSIONS = gql` | ||
query GetSessions { | ||
getAllSessions { | ||
id | ||
Sessionname | ||
description | ||
platform | ||
duration | ||
organizer | ||
} | ||
} | ||
`; | ||
|
||
// Mutation to create a new session | ||
export const CREATE_SESSION = gql` | ||
mutation CreateSession($sessionInput: SessionInput) { | ||
createSession(sessionInput: $sessionInput) { | ||
id | ||
Sessionname | ||
description | ||
platform | ||
duration | ||
organizer | ||
} | ||
} | ||
`; | ||
|
||
// Mutation to delete a session by ID | ||
export const DELETE_SESSION = gql` | ||
mutation DeleteSession($ID: ID!) { | ||
deleteSession(ID: $ID) | ||
} | ||
`; | ||
|
||
// Mutation to edit/update a session by ID | ||
export const EDIT_SESSION = gql` | ||
mutation EditSession($ID: ID!, $editSessionInput: EditSessionInput) { | ||
editSession(id: $ID, editSessionInput: $editSessionInput) | ||
} | ||
`; |
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