LICENSE.md
This commit is contained in:
@@ -9,7 +9,6 @@ import 'cookie_client_stub.dart'
|
||||
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:graphql_flutter/graphql_flutter.dart';
|
||||
|
||||
import 'package:imagini/graphql/imagini_graphql.dart';
|
||||
|
||||
class APIProvider{
|
||||
@@ -54,27 +53,32 @@ class APIProvider{
|
||||
String password,
|
||||
]) async {
|
||||
assert(
|
||||
(username != null && password != null) ||
|
||||
(_accessToken != null && _refreshToken != null)
|
||||
(username != null && password != null)
|
||||
);
|
||||
|
||||
QueryResult response = await _client.query(
|
||||
QueryOptions(
|
||||
document: LoginQuery().document,
|
||||
variables: {
|
||||
"user": "admin",
|
||||
"password": "admin"
|
||||
"user": username,
|
||||
"password": password
|
||||
},
|
||||
)
|
||||
);
|
||||
|
||||
final loginResponse = Login$Query.fromJson(response.data);
|
||||
print(loginResponse);
|
||||
|
||||
return loginResponse.login;
|
||||
}
|
||||
|
||||
void logout() {
|
||||
Future<Me$Query$User> me() async {
|
||||
QueryResult response = await _client.query(
|
||||
QueryOptions(
|
||||
document: MeQuery().document,
|
||||
)
|
||||
);
|
||||
|
||||
final meResponse = Me$Query.fromJson(response.data);
|
||||
return meResponse.me;
|
||||
}
|
||||
|
||||
Future<String> mediaItems([
|
||||
|
||||
Reference in New Issue
Block a user