Skip to content

christofur/graphql-umbraco

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

graphql-umbraco

A GraphQL server for Umbraco built on express-graphql

Install

Clone this repository locally and run npm install. Add your database connection details to src/config/config.js:

        host: '1.100.123.123',
        port: 1433,
        dialect: 'mssql',
        database: 'my-umbraco-7',
        username: 'bob',
        password: ''

We're done!

Usage

Start the server using:

npm start

By default, graphql-umbraco comes bundled with the GraphiQL interface for building and running GraphQL queries.

Note:

Once your server has started, browse to /graphiql to use GraphiQL. This URL can be changed in config.js

You can now run basic GraphQL queries against Umbraco. Here's how to query a node by id

gives the result:

Query result

Tests

npm test

Goals

  • Query nodes by URL
  • Cache nodes and properties
  • Replace the wonky current test mocks with proper Sinon.js mocks
  • Recursive, get children to n depth
  • Get ancestors
  • Automatically resolve media URLs by Id
  • Sample React application using Relay architecture
  • Remove dependency on babel-cli for npm tasks

Note:

graphql-umbraco is pre-alpha. Ideas will be tried out and things will break. Don't use graphql-umbraco in any production setting.

Contribute

Pull requests and ideas very much welcome. The best place to chat to me is on Twitter at @perksc

About

GraphQL proxy for Umbraco

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors