Git Product home page Git Product logo

curious-cases-of-graphql's Introduction

Curious Cases of GraphQL

Case 1: Real-time collaborative drawing canvas with GraphQL & AWS AppSync

GitHub repo

Base schema:

type Canvas @model {
  id: ID!
  clientId: String!
  data: String!
}

type Mutation {
  createCanvas(input: CreateCanvasInput!): Canvas
  updateCanvas(input: UpdateCanvasInput!): Canvas
  deleteCanvas(input: DeleteCanvasInput!): Canvas
}

type Query {
  getCanvas(id: ID!): Canvas
  listCanvass(filter: ModelCanvasFilterInput, limit: Int, nextToken: String): ModelCanvasConnection
}


type Subscription {
  onCreateCanvas: Canvas @aws_subscribe(mutations: ["createCanvas"])
  onUpdateCanvas: Canvas @aws_subscribe(mutations: ["updateCanvas"])
}

Case 2: GraphQL Image Rekognition

GitHub repo

Base schema

type ImageData {
  data: String!
}

type Query {
  fetchImage(imageInfo: String!): ImageData
}

Case 3: SpeakerChat - Real-time event comment platform with markdown support

GitHub repo

Base schema:

type Talk @model {
  id: ID!
  title: String!
  speakerName: String!
  clientId: ID
  speakerImage: String
  comments: [Comment] @connection(name: "TalkComments")
}

type Comment @model {
  id: ID!
  talkId: ID!
  clientId: ID
  talk: Talk @connection(sortField: "createdAt", name: "TalkComments", keyField: "talkId")
  text: String
  createdAt: String
  createdBy: String
}

type ModelCommentConnection {
  items: [Comment]
  nextToken: String
}

type Subscription {
  onCreateCommentWithId(talkId: ID!): Comment
		@aws_subscribe(mutations: ["createComment"])
}

type Query {
  listCommentsForTalk(talkId: ID!): ModelCommentConnection
}

Case 4: Hype Beats

GitHub repo

Base schema:

type DrumMachine @model {
  id: ID!
  clientId: ID!
  beats: String!
  name: String!
}

type Query {
  getDrumMachine(id: ID!): DrumMachine
  listDrumMachines(filter: ModelDrumMachineFilterInput, limit: Int, nextToken: String): ModelDrumMachineConnection
}

type Mutation {
  createDrumMachine(input: CreateDrumMachineInput!): DrumMachine
  updateDrumMachine(input: UpdateDrumMachineInput!): DrumMachine
  deleteDrumMachine(input: DeleteDrumMachineInput!): DrumMachine
}

type Subscription {
  onCreateDrumMachine: DrumMachine @aws_subscribe(mutations: ["createDrumMachine"])
  onUpdateDrumMachine: DrumMachine @aws_subscribe(mutations: ["updateDrumMachine"])
}

Case 5: GraphQL text to audio translation

GitHub repo

Base schema:

type Query {
  getTranslatedSentence(sentence: String!, code: String!): TranslatedSentence
}

type TranslatedSentence {
  sentence: String!
}

Case 6: Infra as code with Conference app in a box

GitHub repo

Base schema:

type Talk @model {
  id: ID!
  name: String!
  speakerName: String!
  speakerBio: String!
  time: String
  timeStamp: String
  date: String
  location: String
  summary: String!
  twitter: String
  github: String
  speakerAvatar: String
  comments: [Comment] @connection(name: "TalkComments")
}

type Comment @model {
  id: ID!
  talkId: ID
  talk: Talk @connection(sortField: "createdAt", name: "TalkComments", keyField: "talkId")
  message: String
  createdAt: String
  createdBy: String
  deviceId: ID
}

type Report @model {
	id: ID!
	commentId: ID!
	comment: String!
	talkTitle: String!
	deviceId: ID
}

type ModelCommentConnection {
	items: [Comment]
	nextToken: String
}

type Query {
  listCommentsByTalkId(talkId: ID!): ModelCommentConnection
}

type Subscription {
  onCreateCommentWithId(talkId: ID!): Comment
		@aws_subscribe(mutations: ["createComment"])
}

Case 7 - GraphQL SMS in Markdown

GitHub repoithub.com/dabit3/sms-graphql-ui/settings

Base schema:

type SMS {
	originationNumber: String!
	messageBody: String!
  id: ID!
}

type Query {
	getSMS(originationNumber: String!): SMS
	listSMS(filter: TableSMSFilterInput, limit: Int, nextToken: String): SMSConnection
}

type Subscription {
	onCreateSMS(originationNumber: String, messageBody: String): SMS
		@aws_subscribe(mutations: ["createSMS"])
	onUpdateSMS(originationNumber: String, messageBody: String): SMS
		@aws_subscribe(mutations: ["updateSMS"])
	onDeleteSMS(originationNumber: String, messageBody: String): SMS
		@aws_subscribe(mutations: ["deleteSMS"])
}

type Mutation {
	createSMS(input: CreateSMSInput!): SMS
	updateSMS(input: UpdateSMSInput!): SMS
	deleteSMS(input: DeleteSMSInput!): SMS
}

Case 8 - Write With Me

Real-come collaborative document editing

GitHub repo

Base schema:

type Post @model {
  id: ID!
  clientId: ID!
  markdown: String!
  title: String!
  createdAt: String
}

curious-cases-of-graphql's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.