GraphQL interface between frontend and backend
Notes for when we start to connect the backend up to the frontend
list secrets as of 2024-04-10
- We have a client-side GraphQL query: https://gitlab.com/gitlab-org/gitlab/-/blob/73b868db790b5b034db72ea1ccb619dfedc9c308/ee/app/assets/javascripts/ci/secrets/graphql/queries/client/get_secrets.query.graphql
- The query is resolved:
- by client-side resolvers: https://gitlab.com/gitlab-org/gitlab/-/blob/73b868db790b5b034db72ea1ccb619dfedc9c308/ee/app/assets/javascripts/ci/secrets/graphql/settings.js#L35-56
- using client-side pagination: https://gitlab.com/gitlab-org/gitlab/-/blob/73b868db790b5b034db72ea1ccb619dfedc9c308/ee/app/assets/javascripts/ci/secrets/graphql/settings.js#L28-33
- using this mock data: https://gitlab.com/gitlab-org/gitlab/-/blob/73b868db790b5b034db72ea1ccb619dfedc9c308/ee/app/assets/javascripts/ci/secrets/mock_data.js
- The client-side pagination should be replaced with server-side cursor-based pagination once the data is available from the backend
Once secret data and pagination is available via the backend, we can switch over to it by:
- removing the client-side resolvers and pagination from
graphql/settings.js - removing
@clientfrom the query - moving the query file out of the
/clientdirectory
Query proposal: list secrets
query getSecrets($fullPath: ID!, $isGroup: Boolean = false, $first: Integer, $after: String) {
group(fullPath: $fullPath) @include(if: $isGroup) {
id
fullPath
secrets(first: $first, after: $after) {
count
nodes {
id
key
name
labels
lastAccessed
createdAt
}
pageInfo {
...PageInfo
}
}
}
project(fullPath: $fullPath) @skip(if: $isGroup) {
id
fullPath
secrets(first: $first, after: $after) {
count
nodes {
id
key
name
labels
lastAccessed
createdAt
}
pageInfo {
...PageInfo
}
}
}
}
Query proposal: get secret details
#TODO
Mutation proposal: create/update secret
#TODO
Mutation proposal: delete secret
#TODO
Edited by 🤖 GitLab Bot 🤖