Skip to content

Commit 3be5ebc

Browse files
committed
updated complete project file structure
1 parent 2fd1ad6 commit 3be5ebc

27 files changed

+135
-114
lines changed

app.arc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ graphql-proxy-api
44
@aws
55
runtime nodejs14.x
66

7+
@shared
8+
src src/shared
9+
710
@http
8-
/*
9-
method any
10-
src /src/graphql
11+
any /*

package-lock.json

Lines changed: 8 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
{
22
"name": "graphql-proxy-api",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "GraphQL Proxy API for testing and prototyping.",
55
"author": "Dhyey Thumar",
66
"email": "[email protected]",
77
"license": "MIT",
8-
"main": "api/graphql.js",
8+
"main": "src/http/any-catchall/index.js",
99
"type": "module",
10+
"engines": {
11+
"node": ">=14"
12+
},
1013
"scripts": {
1114
"start": "npx sandbox",
12-
"test": "echo 'Test not working on Begin.com'",
13-
"test:dev": "tape tests/*.test.js | tap-spec"
15+
"test": "tape tests/*.test.js | tap-spec"
1416
},
1517
"repository": {
1618
"type": "git",
@@ -26,13 +28,10 @@
2628
"url": "https://github.com/dhyeythumar/graphql-proxy-api/issues"
2729
},
2830
"homepage": "https://github.com/dhyeythumar/graphql-proxy-api#readme",
29-
"dependencies": {
30-
"axios": "^0.21.4"
31-
},
3231
"devDependencies": {
3332
"@architect/sandbox": "^4.5.2",
3433
"tap-spec": "^5.0.0",
3534
"tape": "^5.4.1",
3635
"tiny-json-http": "^7.3.1"
3736
}
38-
}
37+
}

src/graphql/index.js renamed to src/http/any-catchall/index.js

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,18 @@
11
import arc from "@architect/functions";
2-
import { promisify } from "util";
3-
import path, { resolve } from "path";
2+
import path from "path";
43
import fs from "fs";
54
import { ApolloServer } from "apollo-server-lambda";
65
import {
76
ApolloServerPluginLandingPageProductionDefault,
87
ApolloServerPluginLandingPageLocalDefault,
98
} from "apollo-server-core";
9+
import resolvers from "@architect/shared/resolvers/index.js";
1010

1111
const __dirname = path.resolve();
1212

13-
const readdir = promisify(fs.readdir);
14-
async function* getFiles(dir) {
15-
const dirents = await readdir(dir, { withFileTypes: true });
16-
for (const dirent of dirents) {
17-
const res = resolve(dir, dirent.name);
18-
if (dirent.isDirectory()) {
19-
yield* getFiles(res);
20-
} else {
21-
yield res;
22-
}
23-
}
24-
}
25-
26-
(async () => {
27-
try {
28-
for await (const f of getFiles("../../var")) {
29-
console.log(f);
30-
}
31-
} catch (err) {
32-
console.error(err);
33-
}
34-
})();
35-
36-
console.info("__dirname", __dirname);
37-
38-
import resolvers from "../resolvers/index.js";
39-
4013
const ServerHandler = new ApolloServer({
4114
typeDefs: fs.readFileSync(
42-
path.join(__dirname, "../", "schema.graphql"),
15+
path.join(__dirname, "./", "schema.graphql"),
4316
"utf8"
4417
),
4518
resolvers,

src/graphql/package-lock.json renamed to src/http/any-catchall/package-lock.json

Lines changed: 33 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"type": "module",
33
"dependencies": {
4-
"@architect/functions": "latest",
54
"apollo-server-core": "^3.3.0",
65
"apollo-server-lambda": "^3.6.1",
7-
"graphql": "^15.5.3"
6+
"graphql": "^15.5.3",
7+
"@architect/functions": "^4.1.1"
88
}
99
}
File renamed without changes.

src/lib/AlbumModule.js renamed to src/shared/lib/AlbumModule.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { jsonPlaceholder } from "../utils/base-axios.js";
1+
import { jsonPlaceholder } from "../utils.js";
22

33
export default class AlbumModule {
44
//* create an Album

src/lib/CommentModule.js renamed to src/shared/lib/CommentModule.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { jsonPlaceholder } from "../utils/base-axios.js";
1+
import { jsonPlaceholder } from "../utils.js";
22

33
export default class CommentModule {
44
//* create a Comment

src/lib/PhotoModule.js renamed to src/shared/lib/PhotoModule.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { jsonPlaceholder } from "../utils/base-axios.js";
1+
import { jsonPlaceholder } from "../utils.js";
22

33
export default class PhotoModule {
44
//* create a Photo

src/lib/PostModule.js renamed to src/shared/lib/PostModule.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { jsonPlaceholder } from "../utils/base-axios.js";
1+
import { jsonPlaceholder } from "../utils.js";
22

33
export default class PostModule {
44
//* create a Post

src/lib/TodoModule.js renamed to src/shared/lib/TodoModule.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { jsonPlaceholder } from "../utils/base-axios.js";
1+
import { jsonPlaceholder } from "../utils.js";
22

33
export default class TodoModule {
44
//* create a Todo

src/lib/UserModule.js renamed to src/shared/lib/UserModule.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { jsonPlaceholder } from "../utils/base-axios.js";
1+
import { jsonPlaceholder } from "../utils.js";
22

33
export default class UserModule {
44
//* create a User

0 commit comments

Comments
 (0)