Amplify-cli: How are resolvers actually attached? Cannot see proper resolver.

Created on 15 Dec 2018  路  6Comments  路  Source: aws-amplify/amplify-cli

* Which Category is your question related to? *
Generation of fields resolvers

* What AWS Services are you utilizing? *
AWS AppSync

* Provide additional details e.g. code snippets *
My local schema looks like this:

type BookEntity @model @searchable {
  id: ID!
  bookSection: String!
  bookOrder: String!
  bookCode: String!
  bookCodeTitleRu: String!
  bookElementOrder: String!
  type: String!
  content: AWSJSON!
  notes: [Note] @connection(name: "BookEntityNotes")
  bookmarks: [Bookmark] @connection(name: "BookEntityBookmarks")
  highlights: [Highlight] @connection(name: "BookEntityHighlights")
}
type Note 
  @model 
  @auth(rules: [{allow: owner}])
{
  id: ID!
  content: String!
  bookEntity: BookEntity! @connection(name: "BookEntityNotes")
}
type Bookmark
  @model 
  @auth(rules: [{allow: owner}])
{
  id: ID!
  bookEntity: BookEntity! @connection(name: "BookEntityBookmarks")
}
type Highlight
  @model 
  @auth(rules: [{allow: owner}])
{
  id: ID!
  bookEntity: BookEntity! @connection(name: "BookEntityHighlights")
}

After amplify push and placing items in BookEntity DynamoDB table I can successfully query BookEntities using following query:

export const listBookEntitys = `query ListBookEntitys(
  $filter: ModelBookEntityFilterInput
  $limit: Int
  $nextToken: String
) {
  listBookEntitys(filter: $filter, limit: $limit, nextToken: $nextToken) {
    items {
      id
      bookSection
     ...

Now, I want to see how an actual resolver works for this query in AWS AppSync Console. So I go there...

In the console's schema definition, I see:

listBookEntitys(filter: ModelBookEntityFilterInput, limit: Int, nextToken: String): ModelBookEntityConnection

ModelBookEntityConnection:

type ModelBookEntityConnection {
    items: [BookEntity]
    nextToken: String
}

screen shot 2018-12-15 at 08 59 01

I see that there is no resolver attached to items field or BookEntity one. What am I missing? How is this works on the front but do not have any resolvers on the back?

Most helpful comment

I spent two hours trying to figure out why my "attach resolver" buttons weren't showing up before finding this issue and scrolling right. I have a moderate resolution screen. Maybe this is a bug, just in the appsync UI?

All 6 comments

@sakhmedbayev The resolvers are attached to the Mutation and Query types.

@jkeys-ecg-nmsu, sorry my bad. It is all because of my screen size :-). I needed to scroll right to see the resolver.

Not a problem!

I spent two hours trying to figure out why my "attach resolver" buttons weren't showing up before finding this issue and scrolling right. I have a moderate resolution screen. Maybe this is a bug, just in the appsync UI?

I spent two hours trying to figure out why my "attach resolver" buttons weren't showing up before finding this issue and scrolling right. I have a moderate resolution screen. Maybe this is a bug, just in the appsync UI?

oh my god! unbelievable. thank you!

@muhendzera @jkeys-ecg-nmsu I'm not sure who should be capturing this issue - but it's a big deal.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mwarger picture mwarger  路  3Comments

nicksmithr picture nicksmithr  路  3Comments

MageMasher picture MageMasher  路  3Comments

jeanpaulcozzatti picture jeanpaulcozzatti  路  3Comments

adriatikgashi picture adriatikgashi  路  3Comments