Skip to content

Instantly share code, notes, and snippets.

@valentinalexeev
Last active December 11, 2018 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save valentinalexeev/9d98076d2903b2a09b84ee0fef1493af to your computer and use it in GitHub Desktop.
Save valentinalexeev/9d98076d2903b2a09b84ee0fef1493af to your computer and use it in GitHub Desktop.
{
"Nicosia": {
"__typename": "City",
"name": "Nicosia"
}
}
scalar DateTime
type CityTranslation {
language: String!
name: String
}
type City @GQLifyModel(dataSource: "firestore", key: "cities") {
name: String! @unique @ID
timezone: String!
translation: [CityTranslation]
events: [Event]
}
type Tag @GQLifyModel(dataSource: "firestore", key: "tags") {
name: String! @unique @ID
emoji: String
events: [Event]
}
type EventThumbnail {
url: String
}
type Event @GQLifyModel(dataSource: "firestore", key: "events") {
title: String!
description: String!
location: String!
address: String!
dateStart: DateTime!
dateEnd: DateTime
url: String! @unique
translated: Boolean
ready: Boolean
loaded: Boolean
tags: [Tag!]
city: City
thumbnail: EventThumbnail
contact: String
}
{
"__typename": "Event",
"address": "address",
"city": "Nicosia",
"dateEnd": "",
"dateStart": "",
"description": "test",
"language": "",
"loaded": false,
"location": "location",
"ready": false,
"source": "",
"tags": {
"AErGsXIuh2z4Pux0RX2e": true,
"XGtMxNrR8iCPGRPsDMv3": true,
}
}
{
"data": {
"events": [
{
"title": "title",
"tags": [],
"city": null
}
]
}
}
# Write your query or mutation here
query {
events {
title
tags {
name
}
city {
name
}
}
}
{
"AErGsXIuh2z4Pux0RX2e": {
"__typename": "Tag",
"name": "music"
},
"XGtMxNrR8iCPGRPsDMv3": {
"__typename": "Tag",
"name": "kids"
}
}
@valentinalexeev
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment