How to execute a 1-many mutation in Android?Is there a way to run Python on Android?How do save an Android Activity state using save instance state?Close/hide the Android Soft KeyboardWhy is the Android emulator so slow? How can we speed up the Android emulator?“Debug certificate expired” error in Eclipse Android pluginsIs there a unique Android device ID?What is 'Context' on Android?Proper use cases for Android UserManager.isUserAGoat()?AWS Amplify GraphQL API in Vue App Returns NullNested mutation GraphQL

Why doesn't H₄O²⁺ exist?

What is the word for reserving something for yourself before others do?

Does a druid starting with a bow start with no arrows?

90's TV series where a boy goes to another dimension through portal near power lines

How can I tell someone that I want to be his or her friend?

Infinite Abelian subgroup of infinite non Abelian group example

Stopping power of mountain vs road bike

Is it possible to run Internet Explorer on OS X El Capitan?

Intersection of two sorted vectors in C++

When a company launches a new product do they "come out" with a new product or do they "come up" with a new product?

Facing a paradox: Earnshaw's theorem in one dimension

If human space travel is limited by the G force vulnerability, is there a way to counter G forces?

SSH "lag" in LAN on some machines, mixed distros

Fully-Firstable Anagram Sets

Assassin's bullet with mercury

Why "Having chlorophyll without photosynthesis is actually very dangerous" and "like living with a bomb"?

How can I fix/modify my tub/shower combo so the water comes out of the showerhead?

How can saying a song's name be a copyright violation?

Why are electrically insulating heatsinks so rare? Is it just cost?

How to prevent "they're falling in love" trope

Can one be a co-translator of a book, if he does not know the language that the book is translated into?

Why does Arabsat 6A need a Falcon Heavy to launch

AES: Why is it a good practice to use only the first 16bytes of a hash for encryption?

Forgetting the musical notes while performing in concert



How to execute a 1-many mutation in Android?


Is there a way to run Python on Android?How do save an Android Activity state using save instance state?Close/hide the Android Soft KeyboardWhy is the Android emulator so slow? How can we speed up the Android emulator?“Debug certificate expired” error in Eclipse Android pluginsIs there a unique Android device ID?What is 'Context' on Android?Proper use cases for Android UserManager.isUserAGoat()?AWS Amplify GraphQL API in Vue App Returns NullNested mutation GraphQL






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I'm using AWS AppSync and Amplify. A snippet of my GraphQL schema look like this:



type Inspection @model 
id: ID!
name: String!
date: AWSDate!
photos: [Photo] @connection(name: "InspectionPhotos")


type Photo @model
id: ID!
inspection: Inspection! @connection(name: "InspectionPhotos")
photo: String!



EDIT: Here's a snippet of my generated schema:



input CreateInspectionInput 
id: ID
name: String!
date: AWSDate!


input CreatePhotoInput
id: ID
photo: String!
photoInspectionId: ID!


type Inspection
id: ID!
name: String!
date: AWSDate!
photos(
filter: ModelPhotoFilterInput,
sortDirection: ModelSortDirection,
limit: Int,
nextToken: String
): ModelPhotoConnection


type Photo
id: ID!
inspection: Inspection!
photo: String!


type Mutation
createInspection(input: CreateInspectionInput!): Inspection
updateInspection(input: UpdateInspectionInput!): Inspection
deleteInspection(input: DeleteInspectionInput!): Inspection
createPhoto(input: CreatePhotoInput!): Photo
updatePhoto(input: UpdatePhotoInput!): Photo
deletePhoto(input: DeletePhotoInput!): Photo



I want to create a new Photo, so my Input look like this:



CreatePhotoInput createPhotoInput = CreatePhotoInput.builder()
.photoInspectionId(inspectionId)
.photo(getS3Key(localPath))
.build();


But when creating the mutation below, I get an error that the field inspection in CreatePhotoMutation.CreatePhoto expects an object of type CreatePhotoMutation.Inspection, not a String.



final CreatePhotoMutation.CreatePhoto expected =
new CreatePhotoMutation.CreatePhoto(
"Photo",
UUID.randomUUID().toString(),
CreatePhotoInput.photoInspectionId(),
CreatePhotoInput.photo());


How can I execute this mutation passing only the photoInspectionId?
Am I missing something, since I'm a beginner on Android and AppSync...










share|improve this question
























  • Are you able to create Photos and Inspections the way you would expect in the Queries area in AWS Appsync? console.aws.amazon.com/appsync/home

    – Chance Smith
    Mar 14 at 13:03











  • @ChanceSmith Yes! Using the Queries area in AWS AppSync, I can create a Photo passing the photoInspectionId. I don't know why only in my Android project the mutation expects a object of type CreatePhotoMutation.Inspection instead of String (photoInspectionId)...

    – thaís.w
    Mar 15 at 4:34











  • Could you also post your schema so that we can create the API on our side and assist you better? -Rohan

    – Rohan Dubal
    Mar 17 at 20:55











  • @RohanDubal I've added the generated schema in my question

    – thaís.w
    Mar 18 at 0:49

















1















I'm using AWS AppSync and Amplify. A snippet of my GraphQL schema look like this:



type Inspection @model 
id: ID!
name: String!
date: AWSDate!
photos: [Photo] @connection(name: "InspectionPhotos")


type Photo @model
id: ID!
inspection: Inspection! @connection(name: "InspectionPhotos")
photo: String!



EDIT: Here's a snippet of my generated schema:



input CreateInspectionInput 
id: ID
name: String!
date: AWSDate!


input CreatePhotoInput
id: ID
photo: String!
photoInspectionId: ID!


type Inspection
id: ID!
name: String!
date: AWSDate!
photos(
filter: ModelPhotoFilterInput,
sortDirection: ModelSortDirection,
limit: Int,
nextToken: String
): ModelPhotoConnection


type Photo
id: ID!
inspection: Inspection!
photo: String!


type Mutation
createInspection(input: CreateInspectionInput!): Inspection
updateInspection(input: UpdateInspectionInput!): Inspection
deleteInspection(input: DeleteInspectionInput!): Inspection
createPhoto(input: CreatePhotoInput!): Photo
updatePhoto(input: UpdatePhotoInput!): Photo
deletePhoto(input: DeletePhotoInput!): Photo



I want to create a new Photo, so my Input look like this:



CreatePhotoInput createPhotoInput = CreatePhotoInput.builder()
.photoInspectionId(inspectionId)
.photo(getS3Key(localPath))
.build();


But when creating the mutation below, I get an error that the field inspection in CreatePhotoMutation.CreatePhoto expects an object of type CreatePhotoMutation.Inspection, not a String.



final CreatePhotoMutation.CreatePhoto expected =
new CreatePhotoMutation.CreatePhoto(
"Photo",
UUID.randomUUID().toString(),
CreatePhotoInput.photoInspectionId(),
CreatePhotoInput.photo());


How can I execute this mutation passing only the photoInspectionId?
Am I missing something, since I'm a beginner on Android and AppSync...










share|improve this question
























  • Are you able to create Photos and Inspections the way you would expect in the Queries area in AWS Appsync? console.aws.amazon.com/appsync/home

    – Chance Smith
    Mar 14 at 13:03











  • @ChanceSmith Yes! Using the Queries area in AWS AppSync, I can create a Photo passing the photoInspectionId. I don't know why only in my Android project the mutation expects a object of type CreatePhotoMutation.Inspection instead of String (photoInspectionId)...

    – thaís.w
    Mar 15 at 4:34











  • Could you also post your schema so that we can create the API on our side and assist you better? -Rohan

    – Rohan Dubal
    Mar 17 at 20:55











  • @RohanDubal I've added the generated schema in my question

    – thaís.w
    Mar 18 at 0:49













1












1








1








I'm using AWS AppSync and Amplify. A snippet of my GraphQL schema look like this:



type Inspection @model 
id: ID!
name: String!
date: AWSDate!
photos: [Photo] @connection(name: "InspectionPhotos")


type Photo @model
id: ID!
inspection: Inspection! @connection(name: "InspectionPhotos")
photo: String!



EDIT: Here's a snippet of my generated schema:



input CreateInspectionInput 
id: ID
name: String!
date: AWSDate!


input CreatePhotoInput
id: ID
photo: String!
photoInspectionId: ID!


type Inspection
id: ID!
name: String!
date: AWSDate!
photos(
filter: ModelPhotoFilterInput,
sortDirection: ModelSortDirection,
limit: Int,
nextToken: String
): ModelPhotoConnection


type Photo
id: ID!
inspection: Inspection!
photo: String!


type Mutation
createInspection(input: CreateInspectionInput!): Inspection
updateInspection(input: UpdateInspectionInput!): Inspection
deleteInspection(input: DeleteInspectionInput!): Inspection
createPhoto(input: CreatePhotoInput!): Photo
updatePhoto(input: UpdatePhotoInput!): Photo
deletePhoto(input: DeletePhotoInput!): Photo



I want to create a new Photo, so my Input look like this:



CreatePhotoInput createPhotoInput = CreatePhotoInput.builder()
.photoInspectionId(inspectionId)
.photo(getS3Key(localPath))
.build();


But when creating the mutation below, I get an error that the field inspection in CreatePhotoMutation.CreatePhoto expects an object of type CreatePhotoMutation.Inspection, not a String.



final CreatePhotoMutation.CreatePhoto expected =
new CreatePhotoMutation.CreatePhoto(
"Photo",
UUID.randomUUID().toString(),
CreatePhotoInput.photoInspectionId(),
CreatePhotoInput.photo());


How can I execute this mutation passing only the photoInspectionId?
Am I missing something, since I'm a beginner on Android and AppSync...










share|improve this question
















I'm using AWS AppSync and Amplify. A snippet of my GraphQL schema look like this:



type Inspection @model 
id: ID!
name: String!
date: AWSDate!
photos: [Photo] @connection(name: "InspectionPhotos")


type Photo @model
id: ID!
inspection: Inspection! @connection(name: "InspectionPhotos")
photo: String!



EDIT: Here's a snippet of my generated schema:



input CreateInspectionInput 
id: ID
name: String!
date: AWSDate!


input CreatePhotoInput
id: ID
photo: String!
photoInspectionId: ID!


type Inspection
id: ID!
name: String!
date: AWSDate!
photos(
filter: ModelPhotoFilterInput,
sortDirection: ModelSortDirection,
limit: Int,
nextToken: String
): ModelPhotoConnection


type Photo
id: ID!
inspection: Inspection!
photo: String!


type Mutation
createInspection(input: CreateInspectionInput!): Inspection
updateInspection(input: UpdateInspectionInput!): Inspection
deleteInspection(input: DeleteInspectionInput!): Inspection
createPhoto(input: CreatePhotoInput!): Photo
updatePhoto(input: UpdatePhotoInput!): Photo
deletePhoto(input: DeletePhotoInput!): Photo



I want to create a new Photo, so my Input look like this:



CreatePhotoInput createPhotoInput = CreatePhotoInput.builder()
.photoInspectionId(inspectionId)
.photo(getS3Key(localPath))
.build();


But when creating the mutation below, I get an error that the field inspection in CreatePhotoMutation.CreatePhoto expects an object of type CreatePhotoMutation.Inspection, not a String.



final CreatePhotoMutation.CreatePhoto expected =
new CreatePhotoMutation.CreatePhoto(
"Photo",
UUID.randomUUID().toString(),
CreatePhotoInput.photoInspectionId(),
CreatePhotoInput.photo());


How can I execute this mutation passing only the photoInspectionId?
Am I missing something, since I'm a beginner on Android and AppSync...







android aws-appsync aws-amplify






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 18 at 0:44







thaís.w

















asked Mar 8 at 0:19









thaís.wthaís.w

64




64












  • Are you able to create Photos and Inspections the way you would expect in the Queries area in AWS Appsync? console.aws.amazon.com/appsync/home

    – Chance Smith
    Mar 14 at 13:03











  • @ChanceSmith Yes! Using the Queries area in AWS AppSync, I can create a Photo passing the photoInspectionId. I don't know why only in my Android project the mutation expects a object of type CreatePhotoMutation.Inspection instead of String (photoInspectionId)...

    – thaís.w
    Mar 15 at 4:34











  • Could you also post your schema so that we can create the API on our side and assist you better? -Rohan

    – Rohan Dubal
    Mar 17 at 20:55











  • @RohanDubal I've added the generated schema in my question

    – thaís.w
    Mar 18 at 0:49

















  • Are you able to create Photos and Inspections the way you would expect in the Queries area in AWS Appsync? console.aws.amazon.com/appsync/home

    – Chance Smith
    Mar 14 at 13:03











  • @ChanceSmith Yes! Using the Queries area in AWS AppSync, I can create a Photo passing the photoInspectionId. I don't know why only in my Android project the mutation expects a object of type CreatePhotoMutation.Inspection instead of String (photoInspectionId)...

    – thaís.w
    Mar 15 at 4:34











  • Could you also post your schema so that we can create the API on our side and assist you better? -Rohan

    – Rohan Dubal
    Mar 17 at 20:55











  • @RohanDubal I've added the generated schema in my question

    – thaís.w
    Mar 18 at 0:49
















Are you able to create Photos and Inspections the way you would expect in the Queries area in AWS Appsync? console.aws.amazon.com/appsync/home

– Chance Smith
Mar 14 at 13:03





Are you able to create Photos and Inspections the way you would expect in the Queries area in AWS Appsync? console.aws.amazon.com/appsync/home

– Chance Smith
Mar 14 at 13:03













@ChanceSmith Yes! Using the Queries area in AWS AppSync, I can create a Photo passing the photoInspectionId. I don't know why only in my Android project the mutation expects a object of type CreatePhotoMutation.Inspection instead of String (photoInspectionId)...

– thaís.w
Mar 15 at 4:34





@ChanceSmith Yes! Using the Queries area in AWS AppSync, I can create a Photo passing the photoInspectionId. I don't know why only in my Android project the mutation expects a object of type CreatePhotoMutation.Inspection instead of String (photoInspectionId)...

– thaís.w
Mar 15 at 4:34













Could you also post your schema so that we can create the API on our side and assist you better? -Rohan

– Rohan Dubal
Mar 17 at 20:55





Could you also post your schema so that we can create the API on our side and assist you better? -Rohan

– Rohan Dubal
Mar 17 at 20:55













@RohanDubal I've added the generated schema in my question

– thaís.w
Mar 18 at 0:49





@RohanDubal I've added the generated schema in my question

– thaís.w
Mar 18 at 0:49












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55054929%2fhow-to-execute-a-1-many-mutation-in-android%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55054929%2fhow-to-execute-a-1-many-mutation-in-android%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

1928 у кіно

Захаров Федір Захарович

Ель Греко