Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Add Fig autocompletion spec #59

Open
timkendall opened this issue Jul 1, 2021 · 0 comments
Open

Add Fig autocompletion spec #59

timkendall opened this issue Jul 1, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@timkendall
Copy link
Owner

timkendall commented Jul 1, 2021

Might be nice to offer an integration with Fig for VSCode-style terminal autocompletion (distribution seems to be as easy as storing a new .js module in ~/.fig/autocomplete; it looks like they might have some package.json integration).

// To learn more about Fig's autocomplete standard visit: https://fig.io/docs/autocomplete/building-a-spec#building-your-first-autocomplete-spec

// The below is a dummy example for git. Make sure to change the file name!
export const completion: Fig.Spec = {
  name: "tql",
  description: "Generate a fluent TypeScript client for your GraphQL API.",
  args: [
    { 
      name: 'schema',
      description: 'GraphQL schema from HTTP endpoint or local .graphql file.',

      // @todo discover a local dir schema via. .graphqlconfig?
      // generators: [
      //   {
      //     script: "git branch -l",
      //     postProcess: function(out) {
      //       return out.split('\n').map(branch => {
      //         return { name: branch, description: "branch"}
      //       })
      //     }
      //   }
      // ]
    }
  ],
  subcommands: [],
  options: [
    {
      name: ["-v", "--version"],
      description: "View tql version",
    },
    {
      name: ["-c", "--client"],
      description: "Generate an SDK client for the API",
    },
    {
      name: ["-t", "--tag"],
      description: 'Semantic versioning tag, ex. "1.0.0" (defaults to "unversioned")'
    },
    {
      name: ['--mutableFields'],
      description: 'Generate schema types and results as mutable (default is read-only).',
    },
    {
      name: '--module-path',
      description: 'Optional path to the @timkendall/tql module to be included (CDN, private registry, etc.).'
    }
  ],
};
@timkendall timkendall added the enhancement New feature or request label Jul 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant