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

Altair Playground updated to version 8.1.3 and configuration input added. #3485

Merged
merged 17 commits into from
Jan 15, 2025

Conversation

reginbald
Copy link
Contributor

@reginbald reginbald commented Jan 14, 2025

Describe your PR and link to any relevant issues.

  • Altair Playground updated to latest version (8.1.3).
  • options input map added to configure Altair.

Example Code:

options := map[string]interface{}{
  "disableAccount": true,
  "persistedSettings": map[string]interface{}{
	  "schema.reloadOnStart":      true,
	  "schema.reload.onEnvChange": true,
  },
  
  "initialEnvironments": map[string]interface{}{
	  "activeSubEnvironment": "v2,
	  "base": map[string]interface{}{
		  "variables": map[string]interface{}{
			  "headers": map[string]interface{}{
				  API_HEADER: "v2",
			  },
		  },
	  },
	  "subEnvironments": []map[string]interface{}{
		  {
			  "id":    "v1",
			  "title": "Version 1",
			  "variables": map[string]interface{}{
				  "accentColor": "#ff0000",
				  "headers": map[string]interface{}{
					  API_HEADER: "v1",
				  },
			  },
		  }, {
			  "id":    "v2",
			  "title": "Version 2",
			  "variables": map[string]interface{}{
				  "headers": map[string]interface{}{
					  API_HEADER: "v2",
				  },
			  },
		  },
	  },
  },
}
playground.AltairHandler("GraphQL playground", "/query", options)

I have:

  • Added tests covering the bug / feature (see testing)
  • Updated any relevant documentation (see docs)

Sorry, something went wrong.

@coveralls
Copy link

coveralls commented Jan 15, 2025

Coverage Status

coverage: 73.891% (-0.02%) from 73.915%
when pulling 8ff6fc7 on reginbald:master
into 83e3979 on 99designs:master.

@StevenACoffman
Copy link
Collaborator

Hey, thank you so much for doing this, and for your patience in working through the issues. I don't have get any notification when the various playgrounds are updated, and we don't have any nice automation that creates updates them, so I really rely on the people like you that use them. (if you know of any, please let me know!)

How did you find out that there was a new version, and where are the altair playground options documented? I'd like to add a link to the documentation so people can customize it for their own needs.

@StevenACoffman StevenACoffman merged commit 7b1908e into 99designs:master Jan 15, 2025
17 checks passed
@reginbald
Copy link
Contributor Author

Hi Steven, thanks for merging my pull request.

Long story short, I'm using both Altair and gqlgen for my api and I needed a new feature from Altair so I looked through the source code here and figured out how to update the version.

Here's a link to the docs relating to the options https://altairgraphql.dev/api/core/config/options/interfaces/AltairConfigOptions

Not sure how you might automate this but maybe you set up a cron github workflow that checks https://github.com/altair-graphql/altair/releases for new releases.

@StevenACoffman
Copy link
Collaborator

Well, thanks very much! If you notice a new Altair release, please know it is very welcome for you to update gqlgen like this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants