Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Failed compiling GraphQL schema: Your GraphQL Schema is using "@connection" directive from an older version of the GraphQL Transformer. #339

Closed
cfzimmerman opened this issue Mar 18, 2022 · 3 comments

Comments

@cfzimmerman
Copy link

Describe the bug

Following Amplify Video docs to try it out on a test project: https://docs.amplify-video.com/docs/Video-on-Demand/Getting-Started-with-VOD
Allowing "Video Add" to create a new GraphQL API generates a model containing an @ connection, which Amplify flags as outdated, preventing deployment of any Amplify Video resources. The offending @ connection line is directly preceded by a DO NOT EDIT comment.
Is this an item that needs to be updated from the Amplify Video side, or can I just adjust the written relationship to be consistent with GraphQL transformer v2? If so, what relationship is best?

Also, replacing the @ connection with a v2 relationship like @ hasOne bypasses this error but brings me to this error next: aws-amplify/amplify-cli#3480. Unsure if they're related. There's also an Amplify depreciation warning present, but, again, unsure if that's wrapped up in this.

To Reproduce

  1. Set up project: Create bare Expo app (Javascript); create new Amplify App via AWS console; deploy basic Auth, Storage, and Data Model via Amplify Studio; pull to local environment; configure boilerplate UI for functional authentication
  2. npm i amplify-category-video -g
  3. Amplify video add

Video-On-Demand
Friendly Name: testvideovod
Default HLS Adaptive Bitrate
Notifications: N
Production: N
Do you want Amplify to create a new GraphQL API to manage your videos (Beta): Y
Permission schema: Any authenticated users can upload videos
Do you want to override your GraphQL schema: N

Expected behavior

GraphQL compiles so that "amplify push" can be used to generate cloud resources.

Versions:

  • Desktop: Macbook Pro, MacOS Monterey
  • Editor: VSCode
  • Expo version: 5.3.0
  • Amplify version: 7.6.25
  • GraphQL transformer version: 2
  • amplify-category-video version: 3.9.2

Screenshots

amplify/backend/api/testvideo/schema.graphql
schema-graphql

@ connection error
@connection-error

userpools error
userpools-error

*** Extra spaces are added between GraphQL @ relationships in this bug report to avoid @-ing other GitHub users with those usernames.

@luciano-schirmer
Copy link

Based on GraphQL Transformer v1 to v2 migration, we should probably need to change the video:VideoObject @connections to video:VideoObject @hasOne.

But this still gives the same error message in my machine.

@luciano-schirmer
Copy link

luciano-schirmer commented Jun 23, 2022

A workaround is to replace the following auth rules:

@auth(
  rules: [
    {allow: public, groups:["Admin"], operations: [create, update, delete, read]},
    {allow: private, operations: [read]}
  ]
)

by this:

@auth(
  rules: [
    {allow: public, operations: [read]}
  ]
)

At least I was able to proceed with no errors.

@cfzimmerman
Copy link
Author

Works beautifully. Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants