4e69153e3e
git-subtree-dir: packages/graphql git-subtree-mainline:ac29392d7f
git-subtree-split:33e2f86ba7
24 lines
746 B
Dart
24 lines
746 B
Dart
import 'package:test/test.dart';
|
|
import 'common.dart';
|
|
|
|
var githubSrc = r'''
|
|
query searchRepos($queryString: String!, $repositoryOrder: RepositoryOrder, $first: Int!) {
|
|
search(type: REPOSITORY, query: $queryString, first: $first) {
|
|
...SearchResultItemConnection
|
|
}
|
|
}
|
|
''';
|
|
|
|
void main() {
|
|
test('can parse formerly-reserved words', () {
|
|
var def = parse(githubSrc).parseOperationDefinition();
|
|
expect(def.isQuery, isTrue);
|
|
expect(def.variableDefinitions.variableDefinitions, hasLength(3));
|
|
|
|
var searchField = def.selectionSet.selections[0].field;
|
|
expect(searchField.fieldName.name, 'search');
|
|
|
|
var argNames = searchField.arguments.map((a) => a.name).toList();
|
|
expect(argNames, ['type', 'query', 'first']);
|
|
});
|
|
}
|