Skip to content

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
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 jennifer-shehane self-requested a review April 23, 2024 13:57
@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.

@cacieprins cacieprins merged commit cdd56ba into cypress-io:develop May 20, 2024
@MikeMcC399 MikeMcC399 mentioned this pull request May 20, 2024
7 tasks
markerikson pushed a commit to replayio-public/cypress-realworld-app that referenced this pull request Jun 25, 2024
cypress-io#1521)

* build: replace express-graphql with graphql-http and graphql-playground-middleware-express

toward resolution of issue cypress-io#1420 and cypress-io#1508

* fix: go ahead and preempt provision of GET at /graphql by graphql-http

with graphql-playground-middleware-express, rather than serving it from GET /gql-playground. This preserves functionality closer to as it was with express-graphql.

* fix: whoops did not mean to modify database.json

* Update backend/app.ts

Co-authored-by: Cacie Prins <cacieprins@users.noreply.github.com>

* style: do not pollute type system with one-off inline types

* fix: consume rename commited on github from reviewer suggestion

* style: do not pollute Query.ts either with one-off inline types

* build: empty commit to clear perhaps spurious circleCI failure on firefox

all specs passing on firefox locally.

---------

Co-authored-by: Cacie Prins <cacieprins@users.noreply.github.com>
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.

4 participants