mutation
Created with <3 with dartpad.dev.
Created with <3 with dartpad.dev.
import 'dart:convert'; | |
import 'package:http/http.dart' as http; | |
void main() async{ | |
final graphQLQuery = { | |
'query': '''mutation Mutation { | |
upsertCourse(classId: 1, title: "english", description:"fff" , creatorId: 1) { | |
id | |
title | |
classId | |
description | |
orderNum | |
} | |
}''' | |
}; | |
final response = await http | |
.post(Uri.parse('https://gentle-hotels-judge-197-232-145-163.loca.lt'), | |
headers: {'Content-Type': 'application/json'}, | |
body: jsonEncode(graphQLQuery) | |
); | |
print(jsonDecode(response.body)); | |
} |