Skip to content

Instantly share code, notes, and snippets.

View factoryhr's full-sized avatar

Factory.dev factoryhr

View GitHub Profile
@factoryhr
factoryhr / GraphQLMutationCreateComment_2
Created May 24, 2022 08:31
IntroductionToGraphQLBlogPost
mutation {
createComment(
parentId: 765,
key: "comment-2",
published: true,
type: "object",
input: {news: {id: 765, type: "object"},
username: "Jane",
email: "jane.bond@test.com",
content: "Fantastic!"
@factoryhr
factoryhr / GraphQLMutationCreateComment_1
Created May 24, 2022 08:30
IntroductionToGraphQLBlogPost
mutation {
createComment(
parentId: 765,
key: "comment-1",
published: true,
type: "object",
input: {news: {id: 765, type: "object"},
username: "Joe",
email: "joe.doe@test.com",
content: "Great news!"
@factoryhr
factoryhr / GraphQLQueryGetNewsSingle
Last active May 24, 2022 08:33
IntroductionToGraphQLBlogPost
{
getNews(id: 765, defaultLanguage: "en") {
id
title
shortText
content {
__typename
... on fieldcollection_NewsText {
text
}
@factoryhr
factoryhr / GraphQLQueryGetNewsListing
Last active May 24, 2022 08:37
IntroductionToGraphQLBlogPost
{
getNewsListing {
edges {
node {
id
title
shortText
}
}
}
@factoryhr
factoryhr / GraphQLResponseIntrospectionNews
Created May 24, 2022 08:21
IntroductionToGraphQLBlogPost
{
"data":{
"__type":{
"name":"object_News",
"fields":[
{
"name":"comments",
"type":{
"kind":"LIST"
}
@factoryhr
factoryhr / GraphQLQueryIntrospectionNews
Last active May 24, 2022 08:38
IntroductionToGraphQLBlogPost
{
__type(name: "object_News") {
name
fields {
name
type {
kind
}
}
}
@factoryhr
factoryhr / GraphQLResponseCreateComment
Created May 24, 2022 08:18
IntroductionToGraphQLBlogPost
{
"data":{
"createComment":{
"success":true,
"message":"object created: 1159",
"output":{
"content":"Great news!"
}
}
}
@factoryhr
factoryhr / GraphQLMutationCreateComment
Created May 24, 2022 08:18
IntroductionToGraphQLBlogPost
mutation {
createComment(
parentId: 765
key: "comment-1"
published: true
type: "object"
input: { news: { id: 765, type: "object" }, content: "Great news!" }
) {
success
message
@factoryhr
factoryhr / GraphQLResponseGetNews
Created May 24, 2022 08:16
IntroductionToGraphQLBlogPost
{
"data":{
"getNews":{
"id":"765",
"title":"Montery Car Week Spring Edition",
"shortText":"Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. (...)",
"date":"26.08.2019"
}
}
}
@factoryhr
factoryhr / GraphQLQueryGetNews
Last active May 24, 2022 08:14
IntroductionToGraphQLBlogPost
{
getNews(id: 765, defaultLanguage: "en") {
id
title
shortText
date
}
}