Created with <3 with dartpad.dev.
Created
October 10, 2022 09:19
-
-
Save Quingsley/b202f931105b43911aceefd621951b7a to your computer and use it in GitHub Desktop.
queries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert'; | |
import 'package:http/http.dart' as http; | |
void main() async{ | |
final graphQLQuery = { | |
'query': '''query GetSections { | |
getSections { | |
id | |
courseId | |
topic | |
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)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment