Skip to content

Commit

Permalink
addGeiBasic
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelbrui committed Aug 28, 2023
1 parent ecd0d20 commit 8b98e96
Show file tree
Hide file tree
Showing 13 changed files with 1,063 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/integrations/gei-basic/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["../../../.eslintrc"]
}
16 changes: 16 additions & 0 deletions packages/integrations/gei-basic/.graphql-editor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"namespace": "editor-integrations",
"project": "basic",
"version": "0.0.1",
"typingsEnv": "node",
"typingsHost": "http://localhost:8080/",
"typingsDir": "./src",
"backendSrc": "./src",
"backendLib": "./lib",
"schemaDir": "./",
"integrationPath": "src/index.ts",
"registry": "https://registry.npmjs.org/",
"npmPackage": "gei-basic",
"integrationName": "gei-basic",
"projectVersion": "latest"
}
8 changes: 8 additions & 0 deletions packages/integrations/gei-basic/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"arrowParens": "always",
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 120,
"tabWidth": 2
}
37 changes: 37 additions & 0 deletions packages/integrations/gei-basic/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "gei-basic",
"version": "0.1.0",
"description": "Automatically generated by graphql-editor-cli",
"main": "index.js",
"scripts": {
"start": "gecli dev",
"build": "tsc",
"watch": "tsc --watch",
"update": "gecli schema && gecli typings",
"temp-db": "docker run -p 27017:27017 --rm mongo",
"integrate": "gecli gei integrate",
"publish": "gecli gei publish"
},
"author": "GraphQL Editor Centaur Generator",
"license": "ISC",
"type": "module",
"devDependencies": {
"@types/node": "^18.7.18",
"@types/node-fetch": "^2.6.2",
"@types/ws": "^8.5.4",
"@typescript-eslint/eslint-plugin": "^5.38.0",
"@typescript-eslint/parser": "^5.38.0",
"eslint": "^8.23.1",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.7.1",
"ts-node": "^10.9.1",
"typescript": "^4.8.3"
},
"dependencies": {
"node-fetch": "^3.2.10",
"stucco-js": "^0.10.18",
"ws": "^8.12.0",
"graphql-editor-cli": "^0.7.6"
}
}
6 changes: 6 additions & 0 deletions packages/integrations/gei-basic/schema.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@


type Query{
pipe: Query
passSource: Query
}
7 changes: 7 additions & 0 deletions packages/integrations/gei-basic/src/Query/passSource.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { FieldResolveInput } from 'stucco-js';
import { resolverFor } from '../zeus/index.js';

export const handler = async (input: FieldResolveInput) =>
resolverFor('Query', 'passSource', async () => {
return input.source;
})(input.arguments);
7 changes: 7 additions & 0 deletions packages/integrations/gei-basic/src/Query/pipe.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { FieldResolveInput } from 'stucco-js';
import { resolverFor } from '../zeus/index.js';

export const handler = async (input: FieldResolveInput) =>
resolverFor('Query', 'pipe', async () => {
return {};
})(input.arguments);
21 changes: 21 additions & 0 deletions packages/integrations/gei-basic/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { NewIntegration } from 'graphql-editor-cli';

import { handler as pipe } from './Query/pipe.js';
import { handler as passSource } from './Query/passSource.js';

export const integration = NewIntegration({
Query: {
pipe: {
name: 'Pipe resolver',
description: 'Pass the resolver and go furhter',
handler: pipe,
},
passSource: {
name: 'Pass the source resolver',
description: 'Pass the resolver and go furhter. Pass the source to the next resolver',
handler: passSource,
},
},
});

export default integration;
37 changes: 37 additions & 0 deletions packages/integrations/gei-basic/src/integration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
type IntegrationData = {
name: string;
description: string;
value: string | string[];
required?: boolean;
};

type IntegrationSpecification = {
[resolver: string]: {
name: string;
description: string;
data: Record<string, IntegrationData>;
resolve: { name: string };
};
};

// Declare your resolver specifications here to generate JSON from it later using `gei integrate` command
const integration: IntegrationSpecification = {
['Query.pipe']: {
data: {},
description: 'Pass the resolver and go furhter',
name: 'Pipe resolver',
resolve: {
name: 'lib/Query/pipe',
},
},
['Query.passSource']: {
data: {},
description: 'Pass the resolver and go furhter. Pass the source to the next resolver',
name: 'Pass the source resolver',
resolve: {
name: 'lib/Query/passSource',
},
},
};

export default integration;
16 changes: 16 additions & 0 deletions packages/integrations/gei-basic/src/zeus/const.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* eslint-disable */

export const AllTypesProps: Record<string,any> = {

}

export const ReturnTypes: Record<string,any> = {
Query:{
pipe:"Query",
passSource:"Query"
}
}

export const Ops = {
query: "Query" as const
}
Loading

0 comments on commit 8b98e96

Please sign in to comment.