#Please help with a GraphQL query to copy
1 messages · Page 1 of 1 (latest)
Can you help me fix this? Essentially I need to copy all the app files except for some specified ones, npm install and get the resulting FSID.
query ($baseImage: FSID!, $app: FSID!) {
core {
filesystem(id: $baseImage) {
copy(from: $app, destPath: "/home/node", exclude: ["node_modules", "cloak.yaml", "scripts"]) {
exec(input: {args: ["npm", "install"], workdir: "/home/node"}) {
fs {
id
}
}
}
}
}
}
response: {
data: { core: { filesystem: { copy: null } } },
errors: [
{
message: 'interface conversion: interface {} is nil, not string',
locations: [ { line: 4, column: 7 } ],
path: [ 'core', 'filesystem', 'copy' ]
}
],
Feels like I messed up the copy() call...
Looks like a bug, but you can try including srcPath: "/" as an arg to copy(...) for now, I think it will workaround
Please create an issue for this when you have a sec, we should fix it
OK will do
question meanwhile on this one which is adapted from the todoapp example
query ($baseImage: FSID!, $app: FSID!) {
core {
filesystem(id: $baseImage) {
exec(
input: {
args: ["npm", "install"]
mounts: [{ fs: $app, path: "/home/node/app" }]
workdir: "/home/node/app"
}
) {
mount(path: "/") {
id
}
}
}
}
}
would this return the fsid of the entire filesystem including the mounted files?
No, if that works it will only include the rootfs files, not the mount at /home/node/app