Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: add programmatic usage #41

Open
Plazide opened this issue Jan 5, 2022 · 3 comments
Open

Feature: add programmatic usage #41

Plazide opened this issue Jan 5, 2022 · 3 comments
Labels
v3.0.0 This will be implemented for version v3.0.0

Comments

@Plazide
Copy link
Owner

Plazide commented Jan 5, 2022

To further enhance the usability of Fauna GQL Upload, I would like to add support for using it programmatically. The package already exports the upload function, which allows developers to upload one or more specific types of resource programmatically. This is not detailed in the documentation, due to it not being finished or flexible enough.

The implemented usage would have to be significantly more flexible and robust. The following are use cases I would like to see supported:

  • Uploading resources individually and getting response data
  • Uploading resources in batch and getting response data
  • Supplying configuration options, without the need for a config file.
  • Triggering GraphQL Codegen

If you have any suggestions/use cases you'd like to be supported, please leave a comment on this issue.

@Plazide Plazide created this issue from a note in Fauna GQL Upload (To do) Jan 5, 2022
@winghouchan
Copy link

Thanks for starting this discussion!

Here are some of my thoughts:

  • I'm thinking at a minimum the abilities of the programmable interface should match the abilities of the command line interface. Some of the features you've listed are already possible via the command line interface, right? Perhaps the first increment of this is just getting parity?
  • Not 100% sure what the value of the codegen is here or the workflow intended. It's the consumer of the GraphQL API that needs the generated code but, depending on how the project is setup, the generated code is written essentially written with the source, not the consumer. The workflow offered by Apollo makes more sense to me.
  • Response data from operations will be useful 👍🏼
    • A use-case: returning the database URL to create the Auth0 API resource (via the Auth0 CLI). I currently make a connection to the Fauna instance after fgu has finished and query the global ID for the database I want to create an Auth0 API resource for. Having this returned by fgu (it already gets logged), would simplify my setup a little and probably make the process faster too.

@seanconnollydev
Copy link
Contributor

Regarding codegen, my package.json typically has a script like this and it works fine: fauna-gql && npm run build:gql

What would programmatic usage gain for codegen?

@Plazide
Copy link
Owner Author

Plazide commented Jan 19, 2022

Well, the built-in support for codegen is for convenience, i.e. not having to setup GraphQL codegen with every new project that uses fauna. But, I can definitely see how this would be redundant to support for programmatic usage. Using the codegen API, like this package does, would give the developer way more flexibility when writing an integration. So, we'll scratch codegen for the time being.

I'm thinking at a minimum the abilities of the programmable interface should match the abilities of the command line interface. Some of the features you've listed are already possible via the command line interface, right? Perhaps the first increment of this is just getting parity?

Feature parity with the CLI should be the goal (I just failed to express that in the initial post). But, I think the first increment could actually be smaller than feature parity. Just getting support for access providers would go a long way. That's the most practical use case I can think of, and would therefore be a good first step.

@Plazide Plazide moved this from To do to In progress in Fauna GQL Upload May 1, 2022
@Plazide Plazide added the v3.0.0 This will be implemented for version v3.0.0 label Jun 19, 2022
@Plazide Plazide removed this from In progress in Fauna GQL Upload Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v3.0.0 This will be implemented for version v3.0.0
Projects
Development

No branches or pull requests

3 participants