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

Update NextJS examples and docuamentation for new App Directory #2760

Merged
merged 11 commits into from
May 26, 2023

Conversation

EmrysMyrddin
Copy link
Collaborator

@EmrysMyrddin EmrysMyrddin commented May 11, 2023

Description

NextJS 13 introduced a new directory layout with the app folder. Some extra configuration is needed to make Yoga working compared to previous legacy pages directory layout.

This PR aims to update examples and integration documentation with this new layout.

fixes #2696

TODO:

  • Update documentation
  • Update example

@changeset-bot
Copy link

changeset-bot bot commented May 11, 2023

⚠️ No Changeset found

Latest commit: be054b6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented May 11, 2023

Apollo Federation Subgraph Compatibility Results

Federation 1 SupportFederation 2 Support
_service🟢
@key (single)🟢
@key (multi)🟢
@key (composite)🟢
repeatable @key🟢
@requires🟢
@provides🟢
federated tracing🟢
@link🟢
@shareable🟢
@tag🟢
@override🟢
@inaccessible🟢
@composeDirective🟢
@interfaceObject🟢

Learn more:

@github-actions
Copy link
Contributor

github-actions bot commented May 11, 2023

🚀 Snapshot Release (rc)

The latest changes of this PR are available as rc on npm (based on the declared changesets):

Package Version Info
graphql-yoga-cloud-run-guide 2.0.0-rc-20230526142752-be054b68 npm ↗︎ unpkg ↗︎
@graphql-yoga/apollo-link 2.0.0-rc-20230526142752-be054b68 npm ↗︎ unpkg ↗︎
@graphql-yoga/urql-exchange 2.0.0-rc-20230526142752-be054b68 npm ↗︎ unpkg ↗︎
@graphql-yoga/redis-event-target 2.0.0-rc-20230526142752-be054b68 npm ↗︎ unpkg ↗︎
@graphql-yoga/typed-event-target 2.0.0-rc-20230526142752-be054b68 npm ↗︎ unpkg ↗︎
@graphql-yoga/graphiql 4.0.0-rc-20230526142752-be054b68 npm ↗︎ unpkg ↗︎
graphql-yoga 4.0.0-rc-20230526142752-be054b68 npm ↗︎ unpkg ↗︎
@graphql-yoga/logger 1.0.0-rc-20230526142752-be054b68 npm ↗︎ unpkg ↗︎
@graphql-yoga/nestjs 2.0.0-rc-20230526142752-be054b68 npm ↗︎ unpkg ↗︎
@graphql-yoga/nestjs-federation 2.0.0-rc-20230526142752-be054b68 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-apollo-inline-trace 2.0.0-rc-20230526142752-be054b68 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-apq 2.0.0-rc-20230526142752-be054b68 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-csrf-prevention 2.0.0-rc-20230526142752-be054b68 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-defer-stream 2.0.0-rc-20230526142752-be054b68 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-disable-introspection 1.0.0-rc-20230526142752-be054b68 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-graphql-sse 2.0.0-rc-20230526142752-be054b68 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-persisted-operations 2.0.0-rc-20230526142752-be054b68 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-prometheus 2.0.0-rc-20230526142752-be054b68 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-response-cache 2.0.0-rc-20230526142752-be054b68 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-sofa 2.0.0-rc-20230526142752-be054b68 npm ↗︎ unpkg ↗︎
@graphql-yoga/render-graphiql 4.0.0-rc-20230526142752-be054b68 npm ↗︎ unpkg ↗︎
@graphql-yoga/subscription 4.0.0-rc-20230526142752-be054b68 npm ↗︎ unpkg ↗︎

@github-actions
Copy link
Contributor

github-actions bot commented May 11, 2023

💻 Website Preview

The latest changes are available as preview in: https://5a81d196.graphql-yoga.pages.dev

@github-actions
Copy link
Contributor

github-actions bot commented May 11, 2023

✅ Benchmark Results

     ✓ no_errors{mode:graphql}
     ✓ expected_result{mode:graphql}
     ✓ no_errors{mode:graphql-jit}
     ✓ expected_result{mode:graphql-jit}
     ✓ no_errors{mode:graphql-response-cache}
     ✓ expected_result{mode:graphql-response-cache}
     ✓ no_errors{mode:graphql-no-parse-validate-cache}
     ✓ expected_result{mode:graphql-no-parse-validate-cache}

     checks.......................................: 100.00% ✓ 356236      ✗ 0     
     data_received................................: 1.5 GB  12 MB/s
     data_sent....................................: 72 MB   599 kB/s
     http_req_blocked.............................: avg=1.38µs   min=800ns    med=1.2µs    max=756.7µs  p(90)=1.7µs    p(95)=2µs     
     http_req_connecting..........................: avg=4ns      min=0s       med=0s       max=455.29µs p(90)=0s       p(95)=0s      
     http_req_duration............................: avg=442.9µs  min=225.5µs  med=358.3µs  max=24.61ms  p(90)=640.5µs  p(95)=672.3µs 
       { expected_response:true }.................: avg=442.9µs  min=225.5µs  med=358.3µs  max=24.61ms  p(90)=640.5µs  p(95)=672.3µs 
     ✓ { mode:graphql-jit }.......................: avg=329.14µs min=225.5µs  med=288.3µs  max=24.61ms  p(90)=346.79µs p(95)=379.97µs
     ✓ { mode:graphql-no-parse-validate-cache }...: avg=692.27µs min=565.79µs med=637.29µs max=18.45ms  p(90)=715µs    p(95)=779.46µs
     ✓ { mode:graphql-response-cache }............: avg=382.84µs min=269.5µs  med=339.6µs  max=21.69ms  p(90)=395.5µs  p(95)=431.26µs
     ✓ { mode:graphql }...........................: avg=463.66µs min=335.3µs  med=398.1µs  max=21.4ms   p(90)=479.04µs p(95)=544.6µs 
     http_req_failed..............................: 0.00%   ✓ 0           ✗ 178118
     http_req_receiving...........................: avg=24.79µs  min=14.2µs   med=20.9µs   max=9.06ms   p(90)=32µs     p(95)=36.6µs  
     http_req_sending.............................: avg=10.48µs  min=5.2µs    med=6.4µs    max=7.46ms   p(90)=10.8µs   p(95)=12.9µs  
     http_req_tls_handshaking.....................: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting.............................: avg=407.62µs min=202.6µs  med=326.5µs  max=24.56ms  p(90)=612.29µs p(95)=639.4µs 
     http_reqs....................................: 178118  1484.289949/s
     iteration_duration...........................: avg=668.78µs min=411.4µs  med=581µs    max=24.85ms  p(90)=853.4µs  p(95)=905µs   
     iterations...................................: 178118  1484.289949/s
     vus..........................................: 1       min=1         max=1   
     vus_max......................................: 2       min=2         max=2   

@EmrysMyrddin EmrysMyrddin force-pushed the doc/2696-next-js-13-integration branch 2 times, most recently from 58ad871 to d576a4b Compare May 12, 2023 13:36
@EmrysMyrddin EmrysMyrddin force-pushed the doc/2696-next-js-13-integration branch from 02e993c to c591df8 Compare May 19, 2023 21:49
@EmrysMyrddin EmrysMyrddin force-pushed the doc/2696-next-js-13-integration branch from 4b636cf to e72117b Compare May 21, 2023 13:56
@EmrysMyrddin EmrysMyrddin requested a review from ardatan May 22, 2023 11:29
@EmrysMyrddin EmrysMyrddin force-pushed the doc/2696-next-js-13-integration branch from e72117b to f5fc922 Compare May 22, 2023 11:44
@EmrysMyrddin EmrysMyrddin force-pushed the doc/2696-next-js-13-integration branch from f5fc922 to ae415ad Compare May 26, 2023 07:57
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need an npm lockfile?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think it is needed, it was probably added by the next project scaffolder.

@EmrysMyrddin EmrysMyrddin force-pushed the doc/2696-next-js-13-integration branch from ae415ad to 99deff5 Compare May 26, 2023 08:02
@github-actions
Copy link
Contributor

diff --git a/website/route-lockfile.txt b/website/route-lockfile.txt
index d1792dc2..a4172aa0 100644
--- a/website/route-lockfile.txt
+++ b/website/route-lockfile.txt
@@ -5,9 +5,7 @@
 /docs/features/apollo-federation
 /docs/features/automatic-persisted-queries
 /docs/features/context
-/docs/features/cookies
 /docs/features/cors
-/docs/features/csrf-prevention
 /docs/features/defer-stream
 /docs/features/envelop-plugins
 /docs/features/error-masking
@@ -38,7 +36,6 @@
 /docs/integrations/integration-with-nestjs
 /docs/integrations/integration-with-nextjs
 /docs/integrations/integration-with-sveltekit
-/docs/integrations/integration-with-uwebsockets
 /docs/integrations/z-other-environments
 /docs/migration/migration-from-apollo-server
 /docs/migration/migration-from-express-graphql

@EmrysMyrddin EmrysMyrddin force-pushed the doc/2696-next-js-13-integration branch from 28a903c to c26c617 Compare May 26, 2023 13:31
@ardatan ardatan force-pushed the doc/2696-next-js-13-integration branch from c26c617 to 6b3c9da Compare May 26, 2023 13:34
@ardatan ardatan force-pushed the doc/2696-next-js-13-integration branch from 6b3c9da to af52c48 Compare May 26, 2023 13:35
@EmrysMyrddin EmrysMyrddin force-pushed the doc/2696-next-js-13-integration branch from f3fc81d to c26c617 Compare May 26, 2023 13:41
@EmrysMyrddin EmrysMyrddin force-pushed the doc/2696-next-js-13-integration branch from c26c617 to af52c48 Compare May 26, 2023 13:43
@ardatan ardatan merged commit 465c50b into main May 26, 2023
@ardatan ardatan deleted the doc/2696-next-js-13-integration branch May 26, 2023 14:42
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.

NextJS 13+ (app/api/graphql/route.js) Integration
3 participants