Skip to content

Commit 8b98e96

Browse files
committed
addGeiBasic
1 parent ecd0d20 commit 8b98e96

File tree

13 files changed

+1063
-0
lines changed

13 files changed

+1063
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["../../../.eslintrc"]
3+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"namespace": "editor-integrations",
3+
"project": "basic",
4+
"version": "0.0.1",
5+
"typingsEnv": "node",
6+
"typingsHost": "http://localhost:8080/",
7+
"typingsDir": "./src",
8+
"backendSrc": "./src",
9+
"backendLib": "./lib",
10+
"schemaDir": "./",
11+
"integrationPath": "src/index.ts",
12+
"registry": "https://registry.npmjs.org/",
13+
"npmPackage": "gei-basic",
14+
"integrationName": "gei-basic",
15+
"projectVersion": "latest"
16+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"arrowParens": "always",
3+
"semi": true,
4+
"trailingComma": "all",
5+
"singleQuote": true,
6+
"printWidth": 120,
7+
"tabWidth": 2
8+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "gei-basic",
3+
"version": "0.1.0",
4+
"description": "Automatically generated by graphql-editor-cli",
5+
"main": "index.js",
6+
"scripts": {
7+
"start": "gecli dev",
8+
"build": "tsc",
9+
"watch": "tsc --watch",
10+
"update": "gecli schema && gecli typings",
11+
"temp-db": "docker run -p 27017:27017 --rm mongo",
12+
"integrate": "gecli gei integrate",
13+
"publish": "gecli gei publish"
14+
},
15+
"author": "GraphQL Editor Centaur Generator",
16+
"license": "ISC",
17+
"type": "module",
18+
"devDependencies": {
19+
"@types/node": "^18.7.18",
20+
"@types/node-fetch": "^2.6.2",
21+
"@types/ws": "^8.5.4",
22+
"@typescript-eslint/eslint-plugin": "^5.38.0",
23+
"@typescript-eslint/parser": "^5.38.0",
24+
"eslint": "^8.23.1",
25+
"eslint-config-prettier": "^8.5.0",
26+
"eslint-plugin-prettier": "^4.2.1",
27+
"prettier": "^2.7.1",
28+
"ts-node": "^10.9.1",
29+
"typescript": "^4.8.3"
30+
},
31+
"dependencies": {
32+
"node-fetch": "^3.2.10",
33+
"stucco-js": "^0.10.18",
34+
"ws": "^8.12.0",
35+
"graphql-editor-cli": "^0.7.6"
36+
}
37+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
3+
type Query{
4+
pipe: Query
5+
passSource: Query
6+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { FieldResolveInput } from 'stucco-js';
2+
import { resolverFor } from '../zeus/index.js';
3+
4+
export const handler = async (input: FieldResolveInput) =>
5+
resolverFor('Query', 'passSource', async () => {
6+
return input.source;
7+
})(input.arguments);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { FieldResolveInput } from 'stucco-js';
2+
import { resolverFor } from '../zeus/index.js';
3+
4+
export const handler = async (input: FieldResolveInput) =>
5+
resolverFor('Query', 'pipe', async () => {
6+
return {};
7+
})(input.arguments);
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { NewIntegration } from 'graphql-editor-cli';
2+
3+
import { handler as pipe } from './Query/pipe.js';
4+
import { handler as passSource } from './Query/passSource.js';
5+
6+
export const integration = NewIntegration({
7+
Query: {
8+
pipe: {
9+
name: 'Pipe resolver',
10+
description: 'Pass the resolver and go furhter',
11+
handler: pipe,
12+
},
13+
passSource: {
14+
name: 'Pass the source resolver',
15+
description: 'Pass the resolver and go furhter. Pass the source to the next resolver',
16+
handler: passSource,
17+
},
18+
},
19+
});
20+
21+
export default integration;
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
type IntegrationData = {
2+
name: string;
3+
description: string;
4+
value: string | string[];
5+
required?: boolean;
6+
};
7+
8+
type IntegrationSpecification = {
9+
[resolver: string]: {
10+
name: string;
11+
description: string;
12+
data: Record<string, IntegrationData>;
13+
resolve: { name: string };
14+
};
15+
};
16+
17+
// Declare your resolver specifications here to generate JSON from it later using `gei integrate` command
18+
const integration: IntegrationSpecification = {
19+
['Query.pipe']: {
20+
data: {},
21+
description: 'Pass the resolver and go furhter',
22+
name: 'Pipe resolver',
23+
resolve: {
24+
name: 'lib/Query/pipe',
25+
},
26+
},
27+
['Query.passSource']: {
28+
data: {},
29+
description: 'Pass the resolver and go furhter. Pass the source to the next resolver',
30+
name: 'Pass the source resolver',
31+
resolve: {
32+
name: 'lib/Query/passSource',
33+
},
34+
},
35+
};
36+
37+
export default integration;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* eslint-disable */
2+
3+
export const AllTypesProps: Record<string,any> = {
4+
5+
}
6+
7+
export const ReturnTypes: Record<string,any> = {
8+
Query:{
9+
pipe:"Query",
10+
passSource:"Query"
11+
}
12+
}
13+
14+
export const Ops = {
15+
query: "Query" as const
16+
}

0 commit comments

Comments
 (0)