2019-09-03 21:56:20 +03:00
|
|
|
import gql from 'graphql-tag';
|
|
|
|
|
|
|
|
export const repository = gql`
|
|
|
|
fragment RepositoryParts on Repository {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const blobWithText = gql`
|
|
|
|
fragment BlobWithTextParts on Blob {
|
|
|
|
id
|
|
|
|
text
|
|
|
|
is_binary: isBinary
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const object = gql`
|
|
|
|
fragment ObjectParts on GitObject {
|
|
|
|
id
|
|
|
|
sha: oid
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const branch = gql`
|
|
|
|
fragment BranchParts on Ref {
|
|
|
|
commit: target {
|
|
|
|
...ObjectParts
|
|
|
|
}
|
|
|
|
id
|
|
|
|
name
|
2019-11-26 09:40:27 +01:00
|
|
|
prefix
|
2019-09-03 21:56:20 +03:00
|
|
|
repository {
|
|
|
|
...RepositoryParts
|
|
|
|
}
|
|
|
|
}
|
|
|
|
${object}
|
|
|
|
${repository}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const pullRequest = gql`
|
|
|
|
fragment PullRequestParts on PullRequest {
|
|
|
|
id
|
|
|
|
baseRefName
|
|
|
|
body
|
|
|
|
headRefName
|
|
|
|
headRefOid
|
|
|
|
number
|
|
|
|
state
|
|
|
|
title
|
|
|
|
merged_at: mergedAt
|
|
|
|
repository {
|
|
|
|
...RepositoryParts
|
|
|
|
}
|
|
|
|
}
|
|
|
|
${repository}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const treeEntry = gql`
|
|
|
|
fragment TreeEntryParts on TreeEntry {
|
|
|
|
path: name
|
|
|
|
sha: oid
|
|
|
|
type
|
|
|
|
mode
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const fileEntry = gql`
|
|
|
|
fragment FileEntryParts on TreeEntry {
|
|
|
|
name
|
|
|
|
sha: oid
|
2019-09-05 01:56:06 +03:00
|
|
|
type
|
2019-09-03 21:56:20 +03:00
|
|
|
blob: object {
|
|
|
|
... on Blob {
|
|
|
|
size: byteSize
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|