All Projects → Kentico → kontent-boilerplate-express-apollo

Kentico / kontent-boilerplate-express-apollo

Licence: MIT license
Kontent Boilerplate for development of Express application using Apollo server and GraphQL.

Programming Languages

javascript
184084 projects - #8 most used programming language
Pug
443 projects
SCSS
7915 projects

Projects that are alternatives of or similar to kontent-boilerplate-express-apollo

fullstack-apollo-subscription-example
A minimal Apollo Server 2 with Apollo Client 2 with Subscriptions application.
Stars: ✭ 72 (+242.86%)
Mutual labels:  apollo-client, apollographql, apollo-server, apollo-server-express
statiq-starter-kontent-lumen
Lumen is a minimal, lightweight, and mobile-first starter for creating blogs using Statiq and Kontent by Kentico.
Stars: ✭ 22 (+4.76%)
Mutual labels:  headless, kentico, headless-cms, kentico-kontent
apollo-express-ts-server-boilerplate
No description or website provided.
Stars: ✭ 29 (+38.1%)
Mutual labels:  apollo, apollographql, apollo-server, apollo-server-express
now-course
Proyecto para el curso de Now.sh en Platzi
Stars: ✭ 19 (-9.52%)
Mutual labels:  apollo, apollo-client, apollographql, apollo-server
GitHunt-Polymer
An example of a client-side app built with Polymer and Apollo Client.
Stars: ✭ 13 (-38.1%)
Mutual labels:  apollo, apollo-client, apollographql
bookshelf
My GraphQL playground
Stars: ✭ 64 (+204.76%)
Mutual labels:  apollo, apollo-client, apollo-server
graphql-workshop
⚒ 🚧 A GraphQL workshop to learn GraphQL implementations
Stars: ✭ 20 (-4.76%)
Mutual labels:  apollo, apollo-client, headless-cms
Link state demo
🚀 Demonstrate how to support multiple stores in Apollo Link State
Stars: ✭ 30 (+42.86%)
Mutual labels:  apollo, apollo-client, apollographql
boilerplate
Boilerplate for @prisma-cms
Stars: ✭ 22 (+4.76%)
Mutual labels:  apollo, apollo-client, headless-cms
apollo-magic-refetch
magically refetches relevant apollo graphql queries after creates, deletes, and association changes
Stars: ✭ 32 (+52.38%)
Mutual labels:  apollo, apollo-client, apollographql
les-chat
Real-time messenger with private, public & group chat. Made using PERN + GraphQL stack.
Stars: ✭ 48 (+128.57%)
Mutual labels:  apollo, apollo-client, apollo-server
Awesome Apollo Graphql
A curated list of amazingly awesome things regarding Apollo GraphQL ecosystem 🌟
Stars: ✭ 126 (+500%)
Mutual labels:  apollo, apollo-client, apollo-server
jest-gql
✅🚀GraphQL based tests for Jest and Apollo
Stars: ✭ 33 (+57.14%)
Mutual labels:  apollo, apollo-client, apollographql
mern-apollo-graphql-boilerplate
MERN + Apollo-Graphql Boilerplate
Stars: ✭ 21 (+0%)
Mutual labels:  apollo, apollographql, apollo-server-express
github-react-native-apollo-graphql
📱 A GitHub mobile app built with React-Native and Apollo GraphQL
Stars: ✭ 24 (+14.29%)
Mutual labels:  apollo, apollo-client, apollographql
React Graphql Github Apollo
🚀 A React + Apollo + GraphQL GitHub Client. Your opportunity to learn about these technologies in a real world application.
Stars: ✭ 1,563 (+7342.86%)
Mutual labels:  apollo, apollo-client, apollographql
gitstar
Github Client built with React Apollo
Stars: ✭ 15 (-28.57%)
Mutual labels:  apollo, apollo-client, apollographql
angular-apollo-starter
Learning apollo-client, graphql with angular6.x
Stars: ✭ 16 (-23.81%)
Mutual labels:  apollo, apollo-client, apollographql
Chatty
A WhatsApp clone with React Native and Apollo (Tutorial)
Stars: ✭ 481 (+2190.48%)
Mutual labels:  apollo, apollo-client, apollo-server
apollo-log
A logging extension for the Apollo GraphQL Server
Stars: ✭ 64 (+204.76%)
Mutual labels:  apollo, apollographql, apollo-server

Kentico Kontent Boilerplate for Express

Boilerplate screenshot

Live demo Stack Overflow

Build Status Maintainability

This boilerplate showcases how it is possible to combine the Node.js web application framework Express with GraphQL.

The server converts the Kontent Delivery REST API to GraphQL using the Apollo framework and then renders the output using the Pug view engine.

Quick start

Prerequisites

Run locally

  1. Clone the repository.
    • git clone https://github.com/Kentico/kontent-boilerplate-express-apollo.git
  2. Navigate to the repository folder.
    • cd kontent-boilerplate-express-apollo
  3. Install the dependencies.
    • npm install
  4. Adjust config.json to point to your localhost
    • "protocol": "http://",
    • "host": "127.0.0.1",
  5. Run the boilerplate.
    • npm run debug
  6. Open http://localhost:3000 in your browser.

Test queries

With your application running, open http://localhost:3000/graphql and enter following query:

{
  itemsByType(
    type: "article"
    limit: 3
    depth: 0
    order: "elements.post_date"
  ) {
    ... on ArticleContentType {
      title {
        value
      }
      summary {
        value
      }
      teaser_image {
        value {
          name
          url
        }
       }
      related_articles{
        value{
    ... on ArticleContentType {
      title{
        value
      }
     }
    }
   }
  }
 }
}

For more complex queries, take a look at the schema definition generated by Apollo. Shema in playground

Other commands

Debug logging

To run the application with debug logging:

npm run debug
  • It is possible to use the Debug server launch configuration if you are using Visual Studio Code for development.

Regenerate GraphQL schema

Schema is generated using the Kentico GraphQL schema generator which automatically generates GraphQL data type schema based on the Kentico Kontent Project ID.

To regenerate the schema, manually run:

npm run generate-schema

How to change Kentico kontent Project ID

  • Change the projectId argument value in the scripts section found in package.json
    • This value is used when the schema is regenerated. Basically, when the application is starting or when the generation is triggered manually
  • Change the of projectId property in config.json
    • This value is used in the application

How to adjust the boilerplate for different projects

Architecture

GraphQL endpoints are provided by the Apollo Server. Implementation of this server requires providing data and query schema and query resolvers.

Data provided by the GraphQL endpoint is consumed in the controller using the Apollo client and rendered using the Pug view engine.

Adjusting the boilerplate to your project

  1. Point the application to your project ID.
  2. Regenerate the schema manually.
  3. Define the queries type schema in queryTypes constant.
  4. Implement the queries by the schema in Query property in resolvers constant.
  5. Use the queries to load data to render in controller.
  6. Adjust the view template to display provided data.

Release info

Deployment to Heroku configured on Heroku. Credentials to Heroku instance are stored on Kentico Secret server.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].