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

<graphql-query> should take a <script> tag #5

Open
bennypowers opened this issue Feb 21, 2018 · 0 comments
Open

<graphql-query> should take a <script> tag #5

bennypowers opened this issue Feb 21, 2018 · 0 comments

Comments

@bennypowers
Copy link

Hey! Thanks for putting this element together, looks great and I'm excited to get cracking with it.

What do you think about making the slot for <graphql-query> take a script element? It would look like this in practise:

  <graphql-query id="query" result="{{starShipsData}}" defer>
    <script type="application/graphql">
      query {
        allStarships(first: 5, filter: {pilots_some: {name_not: ""}}) {
          name
          class
          pilots {
            name
            homeworld {
              name
            }
          }
        }
      }
    </script>
  </graphql-query>

This is how <markdown-element> does things.

Why does this matter?

  1. the content actually is of script type application/graphql, so might as well be explicit
  2. semantically, screen readers etc will skip over the text content of the query
  3. editor tooling could work better inside the script tag (syntax highlighting, etc)

I'm happy to provide a PR

@bennypowers bennypowers changed the title Should <graphql-query> take a <script> tag? <graphql-query> should take a <script> tag Feb 21, 2018
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 a pull request may close this issue.

1 participant