Last active
November 29, 2022 12:50
-
-
Save jpadams/a4e8a5c7de9c4803363d3a9918fc4a19 to your computer and use it in GitHub Desktop.
GraphQL API queries
This file contains hidden or 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
query { | |
git(url: "https://github.com/dagger/dagger") { | |
branch(name: "main") { | |
tree { | |
readme: file(path: "README.md") { | |
contents | |
size | |
} | |
license: file(path: "LICENSE") { | |
contents | |
size | |
} | |
} | |
} | |
} | |
} | |
query Secret { | |
host { | |
envVariable(name: "HOME") { | |
secret { | |
id | |
} | |
} | |
} | |
} | |
query Decode { | |
secret(id: "eyJob3N0X2VudiI6IkhPTUUifQ==") { | |
plaintext | |
} | |
} | |
query { | |
http(url: "http://dagger.io") { | |
size | |
contents | |
} | |
} | |
query { | |
container { | |
from(address: "alpine") { | |
defaultArgs | |
entrypoint | |
platform | |
rootfs { | |
entries | |
} | |
} | |
} | |
} | |
query ContainerDirectory { | |
container { | |
from(address: "alpine") { | |
directory(path: ".") { | |
withNewDirectory(path: "foo") { | |
withNewDirectory(path: "foo/bar/baz") { | |
withNewFile(path: "foo/bar/greeting", contents: "hello, world!\n") { | |
entries(path: "foo/bar") | |
file(path: "foo/bar/greeting") { | |
contents | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
query ContainerApkInfo { | |
container { | |
from(address: "alpine") { | |
withExec(args: ["apk", "info"]) { | |
stdout | |
} | |
} | |
} | |
} | |
query DirectoryFileReadme { | |
host { | |
directory(path: ".") { | |
file(path: "README.md") { | |
contents | |
} | |
} | |
} | |
} | |
query DefaultPlatform { | |
defaultPlatform | |
} | |
query GitRefsHead { | |
git(url: "https://github.com/dagger/dagger", keepGitDir: true) { | |
branch(name: "main") { | |
tree { | |
file(path: ".git/refs/heads/main") { | |
contents | |
} | |
} | |
} | |
} | |
} | |
query NewDir { | |
directory { | |
withNewDirectory(path: "foo") { | |
withNewDirectory(path: "bar/baz") { | |
withNewFile(path: "foo/greeting", contents: "hello, world!\n") { | |
export(path: ".") | |
} | |
} | |
} | |
} | |
} | |
query Ls { | |
host { | |
directory(path: "./foo") { | |
entries | |
} | |
} | |
} | |
query { | |
host { | |
read: directory(path: ".") { | |
file(path: ".markdownlint.yaml") { | |
contents | |
} | |
} | |
home: envVariable(name: "HOME") { | |
value | |
} | |
pwd: envVariable(name: "PWD") { | |
value | |
} | |
write: directory(path: ".") { | |
withNewFile(path: "greeting", contents: "Hello Dagger!") { | |
export(path: ".") | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment