~netlandish/links

5e97f1ecfe9940118375823d064a19ea75f75c8a — Peter Sanchez 21 days ago 35beed0
Fixing incomplete buffer writing on graphql playground
1 files changed, 2 insertions(+), 0 deletions(-)

M core/routes.go
M core/routes.go => core/routes.go +2 -0
@@ 139,6 139,7 @@ func (s *Service) GQLPlayground(c echo.Context) error {
	if err := formatter.WriteCSS(cssw, style); err != nil {
		return fmt.Errorf("Error generating schema HTML: %w", err)
	}
	cssw.Flush()
	cssStyle := cssBuf.String()

	if schemaHTML == "" {


@@ 155,6 156,7 @@ func (s *Service) GQLPlayground(c echo.Context) error {
		if err != nil {
			return fmt.Errorf("Error formatting schema: %w", err)
		}
		schw.Flush()

		schemaHTML = template.HTML(
			fmt.Sprintf("<style>%s</style>%s", cssStyle, schemaBuf.String()),