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

build: replace express-graphql with graphql-http and graphql-playgrou… #1521

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

timheilman
Copy link
Contributor

…nd-middleware-express

toward resolution of issue #1420 and #1508

@cypress-app-bot
Copy link

@timheilman timheilman marked this pull request as draft March 5, 2024 18:20
with graphql-playground-middleware-express, rather than serving it from GET /gql-playground. This preserves functionality closer to as it was with express-graphql.
@timheilman timheilman marked this pull request as ready for review March 5, 2024 18:29
backend/app.ts Outdated Show resolved Hide resolved
createBankAccount: (obj: any, args: any, ctx: any) => {
const account = createBankAccountForUser(ctx.user.id!, args);
return account;
createBankAccount: (obj: any, args: any, ctx: { user: { id: string } }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the initiative here, but it might be better to define a shared ResolverContext type, e.g.

type ResolverContext = {
  user?: Express.User
}

that can be imported into the resolvers, and also passed as a context template type to grapql-http's createHandler function - which will ensure that the context() property has the correct return type

@jennifer-shehane
Copy link
Member

@timheilman Will you have time to address the feedback from review?

@timheilman
Copy link
Contributor Author

Hi there! Sorry for the delay. When I originally opened this PR, I had lots of time on my hands, but now I'm back to working. I merged the first suggested change, and resolved the second by reverting to the any type. My laser-like focus was to remove the error in #1508 caused by #1420. I really like Cypress and was sad to see cypress-realworld-app so dilapidated. It would warm the cockles of my heart to see one of its build warnings disappear.

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.

None yet

4 participants