GitXplorerGitXplorer
v

assembl-graphql-js-server

public
0 stars
1 forks
0 issues

Commits

List of commits on branch master.
Unverified
08def621639f037eeabe886e6af00e0248e968e5

search in ideas, posts or authors for node resolve

vvincentfretin committed 8 years ago
Unverified
00e99bc6f2bccd1545287a61d8e4ba5e02c9b7f3

add data in the resolver + add the creatorId in createPost in the schema

ppaolina92 committed 8 years ago
Unverified
909509bd7ff8ede04c3ca093515e18d004f35bf2

more data in the resolvers

ppaolina92 committed 8 years ago
Unverified
e63fe1a258ed66379b869afc4898b1b33db8a7e3

add createPost mutation to the schema, resolver wip

vvincentfretin committed 8 years ago
Unverified
3e88e627dbd9b2051aacf7000705c72190540941

add addSentiment mutation

vvincentfretin committed 8 years ago
Unverified
4c4e3ea61beb5b43913ec3223b4c7458ccc033ee

use the same schema as python

vvincentfretin committed 8 years ago

README

The README file for this repository.

Phase1 server

The is simple temporary server to be able to work on the Assembl Phase1 UI, while we're developing the server with graphene.

This is a really simple GraphQL server that uses Apollo Server and GraphQL Tools to serve a simple schema.

It uses a very simple in-memory database, so if you restart the server or change the code, the data will reset.

Installation

Clone the repository and run yarn or npm install

git clone https://github.com/vincentfretin/assembl-graphql-js-server
cd assembl-graphql-js-server
yarn

Starting the server

npm start

The server will run on port 3000. You can change this by editing server.js.

Example of query:

curl --silent -XPOST -H "Content-Type:application/json" -d '{ "variables": {"lang": "fr", "identifier": "survey"}, "query": "query MyQuery($lang:String!, $identifier:String!) { ideas(identifier:$identifier) { ... on Thematic { id, title(lang: $lang), description, video { title(lang: $lang), description(lang: $lang), htmlCode }, numPosts, questions: ideas { ... on Idea { id, title, propositions: posts { ... on Proposition { id, creator { id, name }, body, sentimentCounts { like, disagree } } } } } } } }" }' http://localhost:3000/graphql |python -m json.tool

Example of mutation:

mutation {
  addSentiment(postId:"proposition:1", type: DISAGREE) {
  	like, disagree
	}
}