Skip to content

Instantly share code, notes, and snippets.

@wmdmark
Created October 10, 2022 16:13
Show Gist options
  • Save wmdmark/88328e0946658088b5a158ac48d6027e to your computer and use it in GitHub Desktop.
Save wmdmark/88328e0946658088b5a158ac48d6027e to your computer and use it in GitHub Desktop.
import { GraphQLNonNull } from "graphql"
import { GraphQLString } from "graphql"
import { createGQLType } from "../../lib/schema-utils"
export const NodeMeta = createGQLType({
name: "NodeMeta",
fields: {
key: {
type: new GraphQLNonNull(GraphQLString),
description:
"A unique key that can identify this node e.g. cohort:1, user:2, etc."
},
// these fields mirror open graph meta tags: https://ogp.me/
title: {
type: new GraphQLNonNull(GraphQLString),
description:
"The title of your node as it should appear within the graph,"
},
image: {
type: GraphQLString,
description:
"An image URL which should represent your node within the graph."
},
type: {
type: new GraphQLNonNull(GraphQLString),
description: "The type of the node (user, course, cohort, etc.)"
},
url: {
type: GraphQLString,
description: "The canonical URL of your node in the graph"
},
description: {
type: GraphQLString,
description: "A one to two sentence description of your node."
},
// these fields are specific to our implementation
subtitle: {
type: GraphQLString,
description: "The subtitle of this node"
},
icon: {
type: GraphQLString,
description: "The icon of this node"
},
background_image: {
type: GraphQLString,
description: "The image of this node"
},
avatar: {
type: GraphQLString,
description: "The avatar of this node"
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment