Skip to content

Instantly share code, notes, and snippets.

View gmac's full-sized avatar

Greg MacWilliam gmac

View GitHub Profile
module.exports = [
{ insert: 'a man ' },
{ insert: 'a plan', attributes: { italic: true } },
{ insert: ' ' },
{ insert: 'panama', attributes: { bold: true } },
{ insert: '\n' },
{ insert: 'hello', attributes: { italic: true } },
{ insert: ' goodbye\n' },
{ insert: 'bold', attributes: { bold: true } },
{ insert: ' ' },
@gmac
gmac / entrybody.graphql
Created April 22, 2020 21:48
Chorus EntryBody query
query FetchEntry($uuid: String!) {
entry(uuid: $uuid) {
body {
components {
type
attributes {
alignment
}
...ActionboxAttrs
...BlockquoteAttrs
{
"MergedSchema": "directive @boundary on OBJECT | FIELD_DEFINITION\ntype Foo @boundary {\n\tid: ID!\n\tgqlgen: Boolean!\n\tnodejs: Boolean!\n}\ntype Query {\n\trandomFoo: Foo!\n}\n",
"Services": [
{
"Name": "gqlgen",
"ServiceURL": "https://localhost:3000",
},
{
"Name": "nodejs",
"ServiceURL": "https://localhost:3001",
@gmac
gmac / bulk_input.jsonl
Created July 26, 2023 20:46
Bulk Input
{ "input": { "handle": "alpha", "descriptionHtml": "alpha", "title": "Alpha" } }
{ "input": { "handle": "bravo", "descriptionHtml": "bravo", "title": "Bravo" } }
@gmac
gmac / extensions.graphql
Last active February 2, 2025 12:33
Extensions
interface Node {
id: ID!
}
type Product implements Node {
id: ID!
extensions: ProductExtension
}
type ProductExtension {
@gmac
gmac / graphql-response_fixture.rb
Created March 18, 2025 21:22
graphql response fixture
module GraphQL
class ResponseFixture
SYSTEM_TYPENAME = "__typename__"
SCALAR_VALIDATORS = {
"Boolean" => -> (data) { data.is_a?(TrueClass) || data.is_a?(FalseClass) },
"Float" => -> (data) { data.is_a?(Numeric) },
"ID" => -> (data) { data.is_a?(String) || data.is_a?(Integer) },
"Int" => -> (data) { data.is_a?(Integer) },
"String" => -> (data) { data.is_a?(String) },
"JSON" => -> (data) { data.is_a?(Hash) },