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

DPLT-975 feat: support for code-exporter #100

Merged
merged 8 commits into from
Jun 14, 2023
Merged

Conversation

roshaans
Copy link
Contributor

  • Users are able to get some starter code for their queries from the GraphQL Playground
  • Currently we only allow one snippet which makes a simple query and shows the data in the widget

Next Steps

  • Add support for more snippets
    • Subscription Code Snippets
    • Simple Node.js enviornment
    • Add a few options for creating code for widget
      - Table Format
      - Using a Infinite List
  • Use Custom CSS to make the GraphQL playground look cleaner

Loom Video Demo:
https://www.loom.com/share/59bb2b8ea19540458bbfac27918079a6

import { GraphqlPlayground } from "./graphiql";
import dynamic from 'next/dynamic';

const DynamicGraphiQLWithExporter = dynamic(
Copy link
Contributor Author

@roshaans roshaans Jun 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Code exporter plugin does not work in SSR so we have to load it like such.

@roshaans roshaans force-pushed the roshaan/code-export branch from 7a2d0e2 to 2974bae Compare June 13, 2023 18:37
@@ -7,6 +7,7 @@ import {
NearSocialBridgeProvider,
} from "near-social-bridge";
import { IndexerDetailsProvider } from '../contexts/IndexerDetailsContext';
import 'regenerator-runtime/runtime';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roshaans roshaans force-pushed the roshaan/code-export branch from 2974bae to 8eaa46f Compare June 13, 2023 18:43
HASURA_ENDPOINT,
{
method: "POST",
headers: { "x-hasura-role": "roshaan_near" },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be set to current account?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

frontend/src/components/Playground/graphiql.jsx Outdated Show resolved Hide resolved
frontend/package.json Show resolved Hide resolved
frontend/src/components/Playground/graphiql.jsx Outdated Show resolved Hide resolved
@roshaans roshaans merged commit 841e2ae into main Jun 14, 2023
@roshaans roshaans deleted the roshaan/code-export branch June 14, 2023 18:09
This was referenced Jun 20, 2023
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.

2 participants