#Please help with a GraphQL query to copy

1 messages · Page 1 of 1 (latest)

empty compass
#

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...

unborn whale
#

Please create an issue for this when you have a sec, we should fix it

empty compass
#

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?

unborn whale