grand-stack / grandstack.io

GRANDstack website
https://GRANDstack.io
18 stars 20 forks source link

GraphQL syntax highlighting doesn't handle multi-line string argument for directives #26

Open johnymontana opened 4 years ago

johnymontana commented 4 years ago

Multi-line string arguments are frequently used with the @cypher directive, however the Prism syntax highlighter doesn't recognize these strings as multi-line strings and syntax highlights them as GraphQL.

For example:

type Business {
    businessId: ID!
    averageStars: Float! @cypher(statement:"MATCH (this)<-[:REVIEWS]-(r:Review) RETURN avg(r.stars)")
    recommended(first: Int = 1): [Business] @cypher(statement: """
      MATCH (this)<-[:REVIEWS]-(:Review)<-[:WROTE]-(:User)-[:WROTE]->(:Review)-[:REVIEWS]->(rec:Business)
      WITH rec, COUNT(*) AS score
      RETURN rec ORDER BY score DESC LIMIT $first
    """)
    name: String!
    city: String!
    state: String!
    address: String!
    location: Point!
    reviews: [Review] @relation(name: "REVIEWS", direction: "IN")
    categories: [Category] @relation(name: "IN_CATEGORY", direction: "OUT")
}

Screen Shot 2020-05-18 at 6 56 15 AM