From a2e20b38214fe7e3439a3b026ba73ffe5dfd02cf Mon Sep 17 00:00:00 2001 From: Robert Date: Sat, 25 Mar 2023 09:55:38 +0100 Subject: [PATCH] Clean up web client --- .../Artemis.WebClient.Updating.csproj | 1 - .../Queries/GetNextRelease.graphql | 6 ++++ .../Queries/GetReleaseById.graphql | 34 +------------------ .../Queries/GetReleases.graphql | 22 ++++++++++++ 4 files changed, 29 insertions(+), 34 deletions(-) create mode 100644 src/Artemis.WebClient.Updating/Queries/GetNextRelease.graphql create mode 100644 src/Artemis.WebClient.Updating/Queries/GetReleases.graphql diff --git a/src/Artemis.WebClient.Updating/Artemis.WebClient.Updating.csproj b/src/Artemis.WebClient.Updating/Artemis.WebClient.Updating.csproj index 7f2bb002f..f087e1de1 100644 --- a/src/Artemis.WebClient.Updating/Artemis.WebClient.Updating.csproj +++ b/src/Artemis.WebClient.Updating/Artemis.WebClient.Updating.csproj @@ -12,5 +12,4 @@ - diff --git a/src/Artemis.WebClient.Updating/Queries/GetNextRelease.graphql b/src/Artemis.WebClient.Updating/Queries/GetNextRelease.graphql new file mode 100644 index 000000000..6ec87cc1b --- /dev/null +++ b/src/Artemis.WebClient.Updating/Queries/GetNextRelease.graphql @@ -0,0 +1,6 @@ +query GetNextRelease($currentVersion: String, $branch: String!, $platform: Platform!) { + nextPublishedRelease(version: $currentVersion, branch: $branch, platform: $platform) { + id + version + } +} \ No newline at end of file diff --git a/src/Artemis.WebClient.Updating/Queries/GetReleaseById.graphql b/src/Artemis.WebClient.Updating/Queries/GetReleaseById.graphql index e364038ff..584445b52 100644 --- a/src/Artemis.WebClient.Updating/Queries/GetReleaseById.graphql +++ b/src/Artemis.WebClient.Updating/Queries/GetReleaseById.graphql @@ -1,27 +1,3 @@ -query GetReleases($branch: String!, $platform: Platform!, $take: Int!, $after: String) { - publishedReleases( - first: $take - after: $after - where: { - and: [ - { branch: { eq: $branch } } - { artifacts: { some: { platform: { eq: $platform } } } } - ] - } - ) { - pageInfo { - hasNextPage - endCursor - } - nodes { - id - version - createdAt - } - } -} - - query GetReleaseById($id: UUID!) { publishedRelease(id: $id) { branch @@ -47,12 +23,4 @@ query GetReleaseById($id: UUID!) { fragment fileInfo on ArtifactFileInfo { md5Hash downloadSize -} - -query GetNextRelease($currentVersion: String, $branch: String!, $platform: Platform!) { - nextPublishedRelease(version: $currentVersion, branch: $branch, platform: $platform) { - id - version - } -} - +} \ No newline at end of file diff --git a/src/Artemis.WebClient.Updating/Queries/GetReleases.graphql b/src/Artemis.WebClient.Updating/Queries/GetReleases.graphql new file mode 100644 index 000000000..0297b3f39 --- /dev/null +++ b/src/Artemis.WebClient.Updating/Queries/GetReleases.graphql @@ -0,0 +1,22 @@ +query GetReleases($branch: String!, $platform: Platform!, $take: Int!, $after: String) { + publishedReleases( + first: $take + after: $after + where: { + and: [ + { branch: { eq: $branch } } + { artifacts: { some: { platform: { eq: $platform } } } } + ] + } + ) { + pageInfo { + hasNextPage + endCursor + } + nodes { + id + version + createdAt + } + } +} \ No newline at end of file