Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions mock-server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const express = require('express');
const { graphqlHTTP } = require('express-graphql');
const { buildSchema } = require('graphql');

const schema = buildSchema(`
type Query {
hello: String
}
`);

const root = {
hello: () => 'Hello from mock API!',
};

const app = express();
app.use('/v2/graphql', graphqlHTTP({
schema: schema,
rootValue: root,
graphiql: true,
}));

app.listen(4000, () => {
console.log('Mock GraphQL API running at http://localhost:4000/v2/graphql');
});
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,22 @@
"sync-i18n-to-airtable": "npx esno scripts/sync-localizations-to-airtable.ts",
"check-deps": "check-dependency-version-consistency .",
"postinstall": "husky install",
"gql": "env-cmd --silent turbo run gql:generate"
"gql": "env-cmd --silent turbo run gql:generate",
"mock-server": "node mock-server.js"
},
"devDependencies": {
"@manypkg/cli": "^0.21.1",
"@types/cors": "^2",
"@types/express": "^5",
"@types/function-bind": "^1",
"airtable": "^0.12.2",
"buffer": "^5.5.0",
"chalk": "4.1.2",
"check-dependency-version-consistency": "^3.0.3",
"depcheck": "^1.4.7",
"env-cmd": "^10.1.0",
"eslint": "^8.49.0",
"graphql": "^16.8.1",
"graphql": "^16.11.0",
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
"prettier": "^3.2.4",
Expand Down Expand Up @@ -75,6 +79,10 @@
"yarn": "^4.0.0"
},
"dependencies": {
"cors": "^2.8.5",
"express": "^5.1.0",
"express-graphql": "^0.12.0",
"function-bind": "^1.1.2",
"patch-package": "^6.5.0"
}
}
2 changes: 1 addition & 1 deletion packages/data-components/codegen.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
schema: 'https://backpack-api.xnfts.dev/v2/graphql'
schema: 'http://localhost:4000/v2/graphql'
documents: ['src/components/**/*.tsx', 'src/hooks/**/*.ts']
ignoreNoDocuments: true
generates:
Expand Down
2 changes: 1 addition & 1 deletion packages/recoil/codegen.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
schema: 'https://backpack-api.xnfts.dev/v2/graphql'
schema: 'http://localhost:4000/v2/graphql'
documents: ['src/context/Swap/*.ts']
ignoreNoDocuments: true
generates:
Expand Down
Loading