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

Generate image of GraphQL schema with each PR #1244

Closed
palisadoes opened this issue Apr 3, 2023 · 15 comments
Closed

Generate image of GraphQL schema with each PR #1244

palisadoes opened this issue Apr 3, 2023 · 15 comments
Labels
documentation Improvements or additions to documentation feature request no-issue-activity No issue activity

Comments

@palisadoes
Copy link
Contributor

palisadoes commented Apr 3, 2023

Is your feature request related to a problem? Please describe.
The API GraphQL schema is constantly changing and it is difficult to manually document it for all the developers who need to use it in the following repos:

  1. Talawa
  2. Talawa-API
  3. Talawa-Admin

Describe the solution you'd like
We have identified an open source project that can visually represent a GraphQL schema which would be useful to be integrated into the API for all future development.

Visualizer:

We would like to:

  1. Use this software to automatically visualize the latest schema
  2. Output an image of the schema with each PR and have it automatically update:
    1. This repository
    2. The Talawa docs website
  3. Keep the generator code within the Talawa-API repo in a directory tree reserved for GitHub automation (if advisable)

The package offers multiple formats. We should provide a similar array for this to have maximum utility.

Describe alternatives you've considered

N/A

Approach to be followed (optional)

See above

@github-actions github-actions bot added documentation Improvements or additions to documentation unapproved Unapproved for Pull Request labels Apr 3, 2023
@anurag0006
Copy link
Contributor

I would like to work on this issue

@EshaanAgg
Copy link
Contributor

@palisadoes @anurag0006
Perhaps the CLI version of the same tool would be more relevant to us.

But again, the problem with introspection queries remains that they need the development server to be running to be executed, which, as far as I was able to research, is not possible (and recommendable) to do within GitHub workflows.
I would love to hear if you find any solutions to bypass the same problem.

@anshgoyalevil
Copy link
Contributor

@EshaanAgg @palisadoes

I guess we can integrate this thing while implementing Squash, since it provides the development server to be running, which ultimately would help us in generating the images using CLI version.

@anurag0006
Copy link
Contributor

Will research about it properly and we can discuss it again

@palisadoes
Copy link
Contributor Author

Can this be used with a simplified installation process for GitHub?

@anshgoyalevil
Copy link
Contributor

I guess this can be used too. @anurag0006 Check out this supercharge/mongodb-github-action#24 if you face any error while connecting to URL.

@palisadoes
Copy link
Contributor Author

@anurag0006
Copy link
Contributor

"scripts": {
  "generate-docs": "graphql schema:download --endpoint=https://your-api-endpoint/graphql --output=docs/schema.graphql && graphql viz docs/schema.graphql -t html -o docs/schema.html"
}

hii guys, sorry for inactivity for last few days...For using these packages, all of these demand for a "api-endpoint" which means we need a server running for the API to put its link here which is possible for the Local server but how do we do it for the workflows,any advice?

@anurag0006
Copy link
Contributor

@palisadoes @anurag0006 Perhaps the CLI version of the same tool would be more relevant to us.

But again, the problem with introspection queries remains that they need the development server to be running to be executed, which, as far as I was able to research, is not possible (and recommendable) to do within GitHub workflows. I would love to hear if you find any solutions to bypass the same problem.

This is what I was talking about, the cli version of tool would be more implementable

@anurag0006
Copy link
Contributor

@palisadoes, any guidance on how to proceed further

@palisadoes
Copy link
Contributor Author

This PR has created an instance in the push.yml file of the .github directory. Please take a look.

@github-actions
Copy link

This issue did not get any activity in the past 10 days and will be closed in 365 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

@github-actions github-actions bot added the no-issue-activity No issue activity label Apr 21, 2023
@palisadoes
Copy link
Contributor Author

Unassigning due to inactivity and no submitted PR. Others need to get a chance. Please let us know whether you want to be reassigned before someone else requests assignment or select another issue.

@anurag0006
Copy link
Contributor

I did some research on it and came to know that to build the graphql schema on run time, we need the API server to be running at the time which is not a possible in the github workflows(and not a good practice even we find a way to run it)...So we are left with the the command line tool which can be implemented and will create the schema in the CLI...I didn't went with the PR because of Eshaan has already implemented the graphql visualizer which can be accessed in the browser going to : "https://localhost:4000/visualizer" where we get the required Graphql schema on the web...Should I implement the CLI version or its not needed?

@palisadoes
Copy link
Contributor Author

Closing as we have a solution for visualizing the data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation feature request no-issue-activity No issue activity
Projects
None yet
Development

No branches or pull requests

4 participants