get<T extends Model> static method
GraphQLRequest<T>
get<T extends Model>(
- ModelType<
T> modelType, - ModelIdentifier<
T> modelIdentifier, { - String? apiName,
- APIAuthorizationType<
AmplifyAuthProvider> ? authorizationMode, - Map<
String, String> ? headers,
Generates a request for a single instance of the modelType
by ModelIdentifier
.
final request = ModelQueries.get(
Todo.classType,
TodoModelIdentifier(id: 'some-todo-id-123'),
);
Implementation
static GraphQLRequest<T> get<T extends Model>(
ModelType<T> modelType,
ModelIdentifier<T> modelIdentifier, {
String? apiName,
APIAuthorizationType? authorizationMode,
Map<String, String>? headers,
}) {
return ModelQueriesFactory.instance.get<T>(
modelType,
modelIdentifier,
apiName: apiName,
authorizationMode: authorizationMode,
headers: headers,
);
}