Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/typegraphql #86

Merged
merged 15 commits into from
Apr 19, 2020
Merged

feat/typegraphql #86

merged 15 commits into from
Apr 19, 2020

Conversation

rwieruch
Copy link
Owner

  • use TypeGraphQL instead of Apollo Schema + GraphQL Code Gen (server)

@@ -1,14 +1,6 @@
schema: http://localhost:3000/api/graphql

generates:
src/generated/server.ts:
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • remove server graphql code gen in favor of TypeGraphQL

useIndexSignature: true
plugins:
- typescript
- typescript-resolvers
src/generated/client.tsx:
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • keep using client graphql code gen for React Hooks etc.

@@ -47,12 +46,13 @@
"b64-to-blob": "^1.2.19",
"babel-plugin-import": "^1.13.0",
"babel-plugin-inline-import": "^3.0.0",
"babel-plugin-transform-typescript-metadata": "^0.3.0",
"class-validator": "^0.11.1",
Copy link
Owner Author

@rwieruch rwieruch Apr 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -84,10 +84,12 @@
"reflect-metadata": "^0.1.13",
"stripe": "^8.7.0",
"styled-components": "^5.0.0",
"type-graphql": "^0.18.0-beta.16",
Copy link
Owner Author

@rwieruch rwieruch Apr 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"dotenv": "^8.2.0",
"file-saver": "^2.0.2",
"firebase": "^7.7.0",
"firebase-admin": "^8.9.1",
"graphql": "^14.5.8",
"graphql-iso-date": "^3.6.1",
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • built-in in TypeGraphQL

const server = new ApolloServer({
schema,
context: async ({ req, res }): Promise<ResolverContext> => {
const me = await getMe(req, res);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • bonus: changed into middleware

@@ -41,11 +49,15 @@ export const config = {
export default async (req: ServerRequest, res: ServerResponse) => {
const connection = await getConnection();

const schema = await buildSchema({
resolvers,
dateScalarMode: 'isoDate',
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • custom date scalar

@rwieruch rwieruch merged commit 88b697a into master Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant