I think this is a problem with permission possibly?
My schema looks like this on AppSync Console:
input CreateGameRoomInput {
id: ID
}
input CreatePlayerInput {
lastinteraction: AWSTimestamp
name: String!
score: Int
id: ID
gameid: ID!
}
input DeleteGameRoomInput {
id: ID
}
input DeletePlayerInput {
id: ID
}
type GameRoom @aws_iam
@aws_cognito_user_pools {
id: ID!
players(
filter: ModelPlayerFilterInput,
sortDirection: ModelSortDirection,
limit: Int,
nextToken: String
): ModelPlayerConnection
createdAt: AWSDateTime!
updatedAt: AWSDateTime!
}
enum ModelAttributeTypes {
binary
binarySet
bool
list
map
number
numberSet
string
stringSet
_null
}
input ModelBooleanInput {
ne: Boolean
eq: Boolean
attributeExists: Boolean
attributeType: ModelAttributeTypes
}
input ModelFloatInput {
ne: Float
eq: Float
le: Float
lt: Float
ge: Float
gt: Float
between: [Float]
attributeExists: Boolean
attributeType: ModelAttributeTypes
}
input ModelGameRoomConditionInput {
and: [ModelGameRoomConditionInput]
or: [ModelGameRoomConditionInput]
not: ModelGameRoomConditionInput
}
type ModelGameRoomConnection @aws_iam
@aws_cognito_user_pools {
items: [GameRoom]
nextToken: String
}
input ModelGameRoomFilterInput {
id: ModelIDInput
and: [ModelGameRoomFilterInput]
or: [ModelGameRoomFilterInput]
not: ModelGameRoomFilterInput
}
input ModelIDInput {
ne: ID
eq: ID
le: ID
lt: ID
ge: ID
gt: ID
contains: ID
notContains: ID
between: [ID]
beginsWith: ID
attributeExists: Boolean
attributeType: ModelAttributeTypes
size: ModelSizeInput
}
input ModelIntInput {
ne: Int
eq: Int
le: Int
lt: Int
ge: Int
gt: Int
between: [Int]
attributeExists: Boolean
attributeType: ModelAttributeTypes
}
input ModelPlayerConditionInput {
lastinteraction: ModelIntInput
name: ModelStringInput
score: ModelIntInput
gameid: ModelIDInput
and: [ModelPlayerConditionInput]
or: [ModelPlayerConditionInput]
not: ModelPlayerConditionInput
}
type ModelPlayerConnection @aws_iam
@aws_cognito_user_pools {
items: [Player]
nextToken: String
}
input ModelPlayerFilterInput {
lastinteraction: ModelIntInput
name: ModelStringInput
score: ModelIntInput
id: ModelIDInput
gameid: ModelIDInput
and: [ModelPlayerFilterInput]
or: [ModelPlayerFilterInput]
not: ModelPlayerFilterInput
}
input ModelSizeInput {
ne: Int
eq: Int
le: Int
lt: Int
ge: Int
gt: Int
between: [Int]
}
enum ModelSortDirection {
ASC
DESC
}
input ModelStringInput {
ne: String
eq: String
le: String
lt: String
ge: String
gt: String
contains: String
notContains: String
between: [String]
beginsWith: String
attributeExists: Boolean
attributeType: ModelAttributeTypes
size: ModelSizeInput
}
type Mutation @aws_iam
@aws_cognito_user_pools {
createGameRoom(input: CreateGameRoomInput!, condition: ModelGameRoomConditionInput): GameRoom
updateGameRoom(input: UpdateGameRoomInput!, condition: ModelGameRoomConditionInput): GameRoom
deleteGameRoom(input: DeleteGameRoomInput!, condition: ModelGameRoomConditionInput): GameRoom
createPlayer(input: CreatePlayerInput!, condition: ModelPlayerConditionInput): Player
updatePlayer(input: UpdatePlayerInput!, condition: ModelPlayerConditionInput): Player
deletePlayer(input: DeletePlayerInput!, condition: ModelPlayerConditionInput): Player
}
type Player @aws_iam
@aws_cognito_user_pools {
lastinteraction: AWSTimestamp
name: String
score: Int
id: ID!
gameid: ID!
gameroom: GameRoom
createdAt: AWSDateTime!
updatedAt: AWSDateTime!
}
type Query @aws_iam
@aws_cognito_user_pools {
getGameRoom(id: ID!): GameRoom
listGameRooms(filter: ModelGameRoomFilterInput, limit: Int, nextToken: String): ModelGameRoomConnection
getPlayer(id: ID!): Player
listPlayers(filter: ModelPlayerFilterInput, limit: Int, nextToken: String): ModelPlayerConnection
}
type Subscription @aws_iam
@aws_cognito_user_pools {
onCreateGameRoom: GameRoom
@aws_subscribe(mutations: ["createGameRoom"])
onUpdateGameRoom: GameRoom
@aws_subscribe(mutations: ["updateGameRoom"])
onDeleteGameRoom: GameRoom
@aws_subscribe(mutations: ["deleteGameRoom"])
onCreatePlayer: Player
@aws_subscribe(mutations: ["createPlayer"])
onUpdatePlayer: Player
@aws_subscribe(mutations: ["updatePlayer"])
onDeletePlayer: Player
@aws_subscribe(mutations: ["deletePlayer"])
}
input UpdateGameRoomInput {
id: ID!
}
input UpdatePlayerInput {
lastinteraction: AWSTimestamp
name: String
score: Int
id: ID!
gameid: ID
}
So it's supposed to be authorized to see those fileds...
Or, since the authorization like @aws_cognito_user_pools manually from the AppSync console, and so locally Amplify "don't have this update" and maybe is not sending the Cognito Token?
UPDATE
With the "update" subscription, I'm getting all the fields...
HI,
I'm having an issue with subscriptions, since I get the event from
Amplify.subscribe
, but all the fields, except the ID are nullTo Reproduce On the Application
Log in with Cognito
In the console i can see:
And then
I think this is a problem with permission possibly?
My schema looks like this on AppSync Console:
So it's supposed to be authorized to see those fileds...
Or, since the authorization like
@aws_cognito_user_pools
manually from the AppSync console, and so locally Amplify "don't have this update" and maybe is not sending the Cognito Token?UPDATE With the "update" subscription, I'm getting all the fields...