Created
April 5, 2018 14:21
-
-
Save Whoaa512/7143d918aba16d9b201778897db18681 to your computer and use it in GitHub Desktop.
Example of GraphQL files for highlighting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gql from 'graphql-tag' | |
import fragments from '~/graphql/fragments' | |
export default gql` | |
mutation createAnnotation( | |
$attrs: AnnotationInput! | |
) { | |
createAnnotation(attrs: $attrs) { | |
...Annotation | |
threads { | |
...Thread | |
owner { | |
id | |
} | |
} | |
} | |
} | |
${fragments.Annotation} | |
${fragments.Thread} | |
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MetricTypeDefs = ` | |
# Primitive types for conveying geometric data | |
type Metric { | |
count: Int! | |
} | |
# The input for sendMetrics | |
input MetricInput { | |
name: String! | |
points: [Float!]! | |
tags: [String!] | |
# Should be one of ['count', 'gauge', 'rate'] | |
type: String = "gauge" | |
} | |
extend type Mutation { | |
# Send metrics to data dog | |
sendMetrics(metrics: [MetricInput!]!): Metric! | |
} | |
` | |
export default MetricTypeDefs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mutation sendMetrics($metrics: [MetricInput!]!) { | |
sendMetrics(metrics: $metrics) { | |
count | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fragment thread on Thread { | |
id | |
comments { | |
items { | |
id | |
author { | |
id | |
firstName | |
lastName | |
} | |
body | |
createdAt | |
deletedAt | |
editedAt | |
} | |
totalCount | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment