This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CMS | |
const pages = [ | |
{ | |
id: "1", | |
slug: "/", | |
modules: [ | |
{ type: "hero", title: "Hero title", description: "Hero description" }, | |
{ type: "image", title: "Image title", url: "https://..." }, | |
], | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
// 1. Importamos `graphiqlExpress`. | |
const { graphqlExpress, graphiqlExpress } = require('graphql-server-express'); | |
const { makeExecutableSchema } = require('graphql-tools'); | |
const typeDefs = [ | |
` | |
type Query { | |
hello: String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Importamos dependencias. | |
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
const { graphqlExpress } = require('graphql-server-express'); | |
const { makeExecutableSchema } = require('graphql-tools'); | |
// 2. Definimos los diferentes tipos en nuestro schema. | |
const typeDefs = [ | |
` | |
type Query { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Importamos dependencias. | |
const { graphql, buildSchema } = require('graphql'); | |
// 2. Construimos un schema GraphQL usando GraphQL Schema Language. | |
const schema = buildSchema( | |
` | |
type Query { | |
hello: String | |
} |