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

Apollo's graphql-tag javascript gql tag? #12

Open
willstott101 opened this issue Jul 30, 2020 · 1 comment
Open

Apollo's graphql-tag javascript gql tag? #12

willstott101 opened this issue Jul 30, 2020 · 1 comment

Comments

@willstott101
Copy link
Contributor

willstott101 commented Jul 30, 2020

https://github.com/apollographql/graphql-tag

Basically manifests like

const typeDefs = gql`
  # Comments in GraphQL strings (such as this one) start with the hash (#) symbol.

  # This "Book" type defines the queryable fields for every book in our data source.
  type Book {
    title: String
    author: String
  }

  # The "Query" type is special: it lists all of the available queries that
  # clients can execute, along with the return type for each. In this
  # case, the "books" query returns an array of zero or more Books (defined above).
  type Query {
    books: [Book]
  }
`;

in js files.

Would you accept a PR for an extended JS syntax which highlights these prefixed strings correctly?

@Thom1729
Copy link
Contributor

Thom1729 commented Jun 2, 2021

FYI, JS Custom does this; see the GraphQL recipe.

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

No branches or pull requests

2 participants