summaryrefslogtreecommitdiff
path: root/app/graphql/queries
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/queries')
-rw-r--r--app/graphql/queries/design_management/design_permissions.query.graphql13
-rw-r--r--app/graphql/queries/design_management/get_design_list.query.graphql40
-rw-r--r--app/graphql/queries/repository/files.query.graphql76
-rw-r--r--app/graphql/queries/repository/permissions.query.graphql11
-rw-r--r--app/graphql/queries/snippet/project_permissions.query.graphql9
-rw-r--r--app/graphql/queries/snippet/snippet.query.graphql65
-rw-r--r--app/graphql/queries/snippet/snippet_blob_content.query.graphql18
-rw-r--r--app/graphql/queries/snippet/user_permissions.query.graphql9
8 files changed, 241 insertions, 0 deletions
diff --git a/app/graphql/queries/design_management/design_permissions.query.graphql b/app/graphql/queries/design_management/design_permissions.query.graphql
new file mode 100644
index 00000000000..55dfa35129c
--- /dev/null
+++ b/app/graphql/queries/design_management/design_permissions.query.graphql
@@ -0,0 +1,13 @@
+query permissions($fullPath: ID!, $iid: String!) {
+ project(fullPath: $fullPath) {
+ __typename
+ id
+ issue(iid: $iid) {
+ __typename
+ userPermissions {
+ __typename
+ createDesign
+ }
+ }
+ }
+}
diff --git a/app/graphql/queries/design_management/get_design_list.query.graphql b/app/graphql/queries/design_management/get_design_list.query.graphql
new file mode 100644
index 00000000000..ade03d99797
--- /dev/null
+++ b/app/graphql/queries/design_management/get_design_list.query.graphql
@@ -0,0 +1,40 @@
+query getDesignList($fullPath: ID!, $iid: String!, $atVersion: ID) {
+ project(fullPath: $fullPath) {
+ __typename
+ id
+ issue(iid: $iid) {
+ __typename
+ designCollection {
+ __typename
+ copyState
+ designs(atVersion: $atVersion) {
+ __typename
+ nodes {
+ __typename
+ id
+ event
+ filename
+ notesCount
+ image
+ imageV432x230
+ currentUserTodos(state: pending) {
+ __typename
+ nodes {
+ __typename
+ id
+ }
+ }
+ }
+ }
+ versions {
+ __typename
+ nodes {
+ __typename
+ id
+ sha
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/app/graphql/queries/repository/files.query.graphql b/app/graphql/queries/repository/files.query.graphql
new file mode 100644
index 00000000000..232d98a932c
--- /dev/null
+++ b/app/graphql/queries/repository/files.query.graphql
@@ -0,0 +1,76 @@
+fragment PageInfo on PageInfo {
+ __typename
+ hasNextPage
+ hasPreviousPage
+ startCursor
+ endCursor
+}
+
+fragment TreeEntry on Entry {
+ __typename
+ id
+ sha
+ name
+ flatPath
+ type
+}
+
+query getFiles(
+ $projectPath: ID!
+ $path: String
+ $ref: String!
+ $pageSize: Int!
+ $nextPageCursor: String
+) {
+ project(fullPath: $projectPath) {
+ __typename
+ repository {
+ __typename
+ tree(path: $path, ref: $ref) {
+ __typename
+ trees(first: $pageSize, after: $nextPageCursor) {
+ __typename
+ edges {
+ __typename
+ node {
+ ...TreeEntry
+ webPath
+ }
+ }
+ pageInfo {
+ ...PageInfo
+ }
+ }
+ submodules(first: $pageSize, after: $nextPageCursor) {
+ __typename
+ edges {
+ __typename
+ node {
+ ...TreeEntry
+ webUrl
+ treeUrl
+ }
+ }
+ pageInfo {
+ ...PageInfo
+ }
+ }
+ blobs(first: $pageSize, after: $nextPageCursor) {
+ __typename
+ edges {
+ __typename
+ node {
+ ...TreeEntry
+ mode
+ webPath
+ lfsOid
+ }
+ }
+ pageInfo {
+ ...PageInfo
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/app/graphql/queries/repository/permissions.query.graphql b/app/graphql/queries/repository/permissions.query.graphql
new file mode 100644
index 00000000000..c0262a882cd
--- /dev/null
+++ b/app/graphql/queries/repository/permissions.query.graphql
@@ -0,0 +1,11 @@
+query getPermissions($projectPath: ID!) {
+ project(fullPath: $projectPath) {
+ __typename
+ userPermissions {
+ __typename
+ pushCode
+ forkProject
+ createMergeRequestIn
+ }
+ }
+}
diff --git a/app/graphql/queries/snippet/project_permissions.query.graphql b/app/graphql/queries/snippet/project_permissions.query.graphql
new file mode 100644
index 00000000000..0c38e4f8a07
--- /dev/null
+++ b/app/graphql/queries/snippet/project_permissions.query.graphql
@@ -0,0 +1,9 @@
+query CanCreateProjectSnippet($fullPath: ID!) {
+ project(fullPath: $fullPath) {
+ __typename
+ userPermissions {
+ __typename
+ createSnippet
+ }
+ }
+}
diff --git a/app/graphql/queries/snippet/snippet.query.graphql b/app/graphql/queries/snippet/snippet.query.graphql
new file mode 100644
index 00000000000..2205dc26642
--- /dev/null
+++ b/app/graphql/queries/snippet/snippet.query.graphql
@@ -0,0 +1,65 @@
+query GetSnippetQuery($ids: [SnippetID!]) {
+ snippets(ids: $ids) {
+ __typename
+ nodes {
+ __typename
+ id
+ title
+ description
+ descriptionHtml
+ createdAt
+ updatedAt
+ visibilityLevel
+ webUrl
+ httpUrlToRepo
+ sshUrlToRepo
+ blobs {
+ __typename
+ nodes {
+ __typename
+ binary
+ name
+ path
+ rawPath
+ size
+ externalStorage
+ renderedAsText
+ simpleViewer {
+ __typename
+ collapsed
+ renderError
+ tooLarge
+ type
+ fileType
+ }
+ richViewer {
+ __typename
+ collapsed
+ renderError
+ tooLarge
+ type
+ fileType
+ }
+ }
+ }
+ userPermissions {
+ __typename
+ adminSnippet
+ updateSnippet
+ }
+ project {
+ __typename
+ fullPath
+ webUrl
+ }
+ author {
+ __typename
+ id
+ avatarUrl
+ name
+ username
+ webUrl
+ }
+ }
+ }
+}
diff --git a/app/graphql/queries/snippet/snippet_blob_content.query.graphql b/app/graphql/queries/snippet/snippet_blob_content.query.graphql
new file mode 100644
index 00000000000..005f42ff726
--- /dev/null
+++ b/app/graphql/queries/snippet/snippet_blob_content.query.graphql
@@ -0,0 +1,18 @@
+query SnippetBlobContent($ids: [ID!], $rich: Boolean!, $paths: [String!]) {
+ snippets(ids: $ids) {
+ __typename
+ nodes {
+ __typename
+ id
+ blobs(paths: $paths) {
+ __typename
+ nodes {
+ __typename
+ path
+ richData @include(if: $rich)
+ plainData @skip(if: $rich)
+ }
+ }
+ }
+ }
+}
diff --git a/app/graphql/queries/snippet/user_permissions.query.graphql b/app/graphql/queries/snippet/user_permissions.query.graphql
new file mode 100644
index 00000000000..a4914189807
--- /dev/null
+++ b/app/graphql/queries/snippet/user_permissions.query.graphql
@@ -0,0 +1,9 @@
+query CanCreatePersonalSnippet {
+ currentUser {
+ __typename
+ userPermissions {
+ __typename
+ createSnippet
+ }
+ }
+}