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

Add Relay example with TypeScript using Next.js compiler #37450

Closed
wants to merge 6 commits into from

Conversation

tundera
Copy link

@tundera tundera commented Jun 4, 2022

Bug

  • Related issues linked using fixes #number
  • Integration tests added
  • Errors have helpful link attached, see contributing.md

Feature

  • Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
  • Related issues linked using fixes #number
  • Integration tests added
  • Documentation added
  • Telemetry added. In case of a feature if it's used or not.
  • Errors have helpful link attached, see contributing.md

Documentation / Examples

  • Make sure the linting passes by running pnpm lint
  • The examples guidelines are followed from our contributing doc

@ijjk ijjk added the examples Issue/PR related to examples label Jun 4, 2022
@tundera tundera marked this pull request as ready for review June 4, 2022 16:46
Copy link
Member

@balazsorban44 balazsorban44 left a comment

Choose a reason for hiding this comment

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

Thanks, I see we already have a relay example here: https://github.com/vercel/next.js/tree/canary/examples/with-relay-modern should we upgrade that one instead? We can also rename to with-relay, just make sure to leave a README in the old location to point to the new one. 👍

@tundera
Copy link
Author

tundera commented Jun 5, 2022

@balazsorban44 Thanks for the feedback. I'd like to update that old with-relay-modern example, but it's making requests to this GraphQL API which seems to be broken for certain queries. For example, this is the query that's being executed in the current example in with-relay-modern:

{
  viewer {
    allBlogPosts(first: 10, orderBy: {createdAt: desc}) {
      edges {
        node {
          id
          title
        }
      }
    }
  }
}

Running that returns an error message:

{
  "errors": [
    {
      "message": "Error occurred during query execution:\nConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(Error { kind: Db, cause: Some(DbError { severity: \"ERROR\", parsed_severity: Some(Error), code: SqlState(\"42P01\"), message: \"relation \\\"public.BlogPost\\\" does not exist\", detail: None, hint: None, position: Some(Original(164)), where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some(\"parse_relation.c\"), line: Some(1173), routine: Some(\"parserOpenTable\") }) }) })",
      "locations": [
        {
          "line": 4,
          "column": 7
        }
      ],
      "path": [
        "viewer",
        "allBlogPosts",
        "edges"
      ]
    }
  ],
  "data": {
    "viewer": {
      "allBlogPosts": {
        "edges": null
      }
    }
  }
}

Since that example doesn't deploy to Vercel either, I'm not sure it provides a whole lot of value in its current state. The new example I've added here as a replacement uses the GitHub GraphQL API which seems like a more reliable option and less likely to break. I'll add a reference to the README of with-relay-modern to refer to this new example. Let me know if that works or if you'd like to go in a different direction. Thanks!

@balazsorban44
Copy link
Member

I realized there is already PR for this: #33892

@ijjk ijjk force-pushed the canary branch 3 times, most recently from df8579c to 47e5ebe Compare October 25, 2022 16:15
@ijjk ijjk force-pushed the canary branch 2 times, most recently from e078ebe to 6b863fe Compare December 2, 2022 05:49
@ijjk ijjk requested a review from jankaifer as a code owner March 2, 2023 23:39
@ijjk ijjk requested a review from a team as a code owner May 4, 2023 16:19
@leerob
Copy link
Member

leerob commented Jun 15, 2023

#33892 (comment)

@leerob leerob closed this Jun 15, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue/PR related to examples locked
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants