1 year ago

#75747

test-img

fullmoon

iOS Amplify: Access schema.graphql in Swift

The backend developer designed and added Amplify qraphql schema file schema.graphql to the project. I dragged the schema.graphql file to the project like in this example:

enter image description here

Now, I just want to access the query methods in Swift.

I can query generally like this:

Amplify.API.query(request: .list(Device.self)){ event in
}

But not like this:

Amplify.API.query(request: .getDeviceByKitId(kitId: 1)){ event in }

I get errors like:

Type 'GraphQLRequest<_>' has no member 'getDeviceByKitId'

The question is how to access or convert query and mutation methods in schema.graphql into Swift?

ios

swift

graphql

aws-amplify

0 Answers

Your Answer

Accepted video resources