[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/graphql-mode eed3c6ca1c 036/122: Create sample GraphQL ser
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/graphql-mode eed3c6ca1c 036/122: Create sample GraphQL server |
Date: |
Sat, 29 Jan 2022 08:03:31 -0500 (EST) |
branch: elpa/graphql-mode
commit eed3c6ca1c7b3ad77003985662f36d5a5ab3641f
Author: David Vazquez Pua <dvazquezpua@deloitte.nl>
Commit: David Vazquez Pua <dvazquezpua@deloitte.nl>
Create sample GraphQL server
---
test/.gitignore | 1 +
test/index.js | 23 +++++++++++++++++++++++
test/package.json | 16 ++++++++++++++++
test/schema.graphql | 3 +++
test/simple-query.graphql | 3 +++
5 files changed, 46 insertions(+)
diff --git a/test/.gitignore b/test/.gitignore
new file mode 100644
index 0000000000..c2658d7d1b
--- /dev/null
+++ b/test/.gitignore
@@ -0,0 +1 @@
+node_modules/
diff --git a/test/index.js b/test/index.js
new file mode 100644
index 0000000000..c5adfc28ff
--- /dev/null
+++ b/test/index.js
@@ -0,0 +1,23 @@
+'use strict';
+
+var express = require('express');
+var graphqlHTTP = require('express-graphql');
+var buildSchema = require('graphql').buildSchema;
+
+var fs = require('fs');
+
+var schemaContent = fs.readFileSync(__dirname + '/schema.graphql', 'utf-8');
+var schema = buildSchema(schemaContent);
+
+var root = { hello: () => 'Hello world!' };
+
+var app = express();
+app.use('/graphql', graphqlHTTP({
+ schema: schema,
+ rootValue: root,
+ graphiql: true
+}));
+
+const PORT = 4000;
+
+app.listen(PORT, () => console.log(`Now browse to localhost:${PORT}/graphql`));
diff --git a/test/package.json b/test/package.json
new file mode 100644
index 0000000000..66e6a7e426
--- /dev/null
+++ b/test/package.json
@@ -0,0 +1,16 @@
+{
+ "name": "graphql-mode-test-server",
+ "version": "1.0.0",
+ "description": "GraphQL server to test graphql-mode",
+ "main": "index.js",
+ "scripts": {
+ "start": "node index.js",
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "dependencies": {
+ "body-parser": "^1.15.2",
+ "express": "^4.15.0",
+ "express-graphql": "^0.6.3",
+ "graphql": "^0.9.1"
+ }
+}
diff --git a/test/schema.graphql b/test/schema.graphql
new file mode 100644
index 0000000000..6ae991f681
--- /dev/null
+++ b/test/schema.graphql
@@ -0,0 +1,3 @@
+type Query {
+ hello: String
+}
diff --git a/test/simple-query.graphql b/test/simple-query.graphql
new file mode 100644
index 0000000000..eb8f4922ab
--- /dev/null
+++ b/test/simple-query.graphql
@@ -0,0 +1,3 @@
+{
+ hello
+}
- [nongnu] elpa/graphql-mode 14bbd1917e 032/122: Update copyright notice, (continued)
- [nongnu] elpa/graphql-mode 14bbd1917e 032/122: Update copyright notice, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 12ab2d0eb5 060/122: Merge pull request #13 from timoweave/next, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode de4b2e8117 039/122: Remember graphql-url value only if the query is successful, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode ead2f85e12 047/122: add error handling, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 22cb9d4594 071/122: Support customizing the headers sent with the request, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 1210279ff4 063/122: Add keywords only completion, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 4bb868832f 078/122: Avoid double-encoding variables in JSON, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode a665c9514a 054/122: fix docstring, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 4c87cdab57 018/122: Fix: make the graphql-url buffer-local before the mode is enabled, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 319dfd97d7 011/122: Define graphql-send-query, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode eed3c6ca1c 036/122: Create sample GraphQL server,
ELPA Syncer <=
- [nongnu] elpa/graphql-mode 404aa31258 104/122: Save json to graphql-edit-headers, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 16c3d63521 002/122: First commit, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 5bd8b6273e 003/122: fontify more graphql constructions, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode bf0412def0 006/122: Better fontification of type [implements X]?, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 1f3bd34b18 064/122: Merge pull request #14 from davazp/next, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode b1aea740ac 052/122: Some fixes to the support of variables, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode e254c7405d 037/122: graphql-send-query uses the whole buffer, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 03312c9f1c 045/122: add variables file support, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 09669d4343 089/122: Merge pull request #28 from charles-boyd/enhancement/add-missing-graphql-keywords, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode a20eb1a7cb 100/122: Move code to bottom, ELPA Syncer, 2022/01/29