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

Allow generation of schema from JSON file #48

Closed
AlexGustafsson opened this issue Sep 22, 2021 · 4 comments
Closed

Allow generation of schema from JSON file #48

AlexGustafsson opened this issue Sep 22, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@AlexGustafsson
Copy link

AlexGustafsson commented Sep 22, 2021

Is your feature request related to a problem? Please describe.
The current generation tool relies on executing a query on the target API endpoint. This may cause authentication issues, rate limiting etc.

Describe the solution you'd like
I'd like to be able to generate a tool based on provided JSON data, such as GitHub's official GraphQL API schema: https://github.com/octokit/graphql-schema/blob/master/schema.json.

Describe alternatives you've considered
Switching library, using other tool for generating the code, host the schema to use existing functionality requiring the endpoint to be active.

Additional context

@maticzav
Copy link
Owner

Hey! 👋

Could you explain why authentication is an issue? I understand that this feature would be great, but at the same time, I don't see how it is blocking anyone. We support authentication and rate-limiting shouldn't be an issue. Maybe I am missing something ...

@maticzav maticzav added the enhancement New feature or request label Nov 16, 2021
@simpers
Copy link

simpers commented Apr 6, 2022

I'll agree with @AlexGustafsson that this feature would be good to have.

We generate our schema from the server-side as a JSON file that can then be used by the client(s) instead of forcing us to temporarily host the dev server (for example) for the tool to fetch it and then shut it down. Some might not even be able to run the dev server, actually. So this is my main reason. Less friction in the team.

@paambaati
Copy link

+1 for schema generation from a local file (even GraphQL is fine for our use-case).

During local development, we can often get rate-limited from the backend. Being able to generate from a locally available schema file is very convenient.

@maticzav
Copy link
Owner

maticzav commented Aug 4, 2022

The new version of SwiftGraphQL now supports loading schema from the JSON introspection file.

@maticzav maticzav closed this as completed Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants