Closed yaquawa closed 3 years ago
It works as any other GraphQL implementation with it comes to related data, your example is the 'Has one' scenario from the docs.
I suggest to take a look at the build
folder of your API where you can see the generated resolvers, also the AppSync console is a great help to better understand what is being generated/deployed for you.
The Project.team
resolver is responsible to return the team data for a given project (as you query it through the Project
type). In the AppSync console you can see the attached resolver to the team
field.
I hope this answers your question, if you are just getting started with GraphQL and Amplify I would suggest to go through the various QuickStarts we have on the docs site.
Hi @attilah , thanks for the information!
Do you mean the resolver of getProject
don't have to return a Project
object?
It is allowed to return only partial fields of the Project
object, and the lucked fields (team
in this example) could be resolved from another resolver(Project.team
in this example)?
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server *-help
channels for those types of questions.
Hi, I'm having an error when referring a specific relationship field, so I decide take a look at the generated vtl resolvers. But I can't understand how it works with the
@connection
..For example:
it gets something like this:
the source of the
Project
is a DynamoDB table, but it doesn't contain ateam
attribute, so how could the vtl resolver return such an object with theteam
field set? I can't see any related code in the vtl template forgetProject
. anyone tell me why? and how does it work?