...
1- name: valid subscription
2 rule: SingleFieldSubscriptions
3 schema: 0
4 query: |2-
5
6 subscription ImportantEmails {
7 importantEmails
8 }
9
10 errors: []
11- name: fails with more than one root field
12 rule: SingleFieldSubscriptions
13 schema: 0
14 query: |2-
15
16 subscription ImportantEmails {
17 importantEmails
18 notImportantEmails
19 }
20
21 errors:
22 - message: Subscription "ImportantEmails" must select only one top level field.
23 locations:
24 - {line: 4, column: 9}
25- name: fails with more than one root field including introspection
26 rule: SingleFieldSubscriptions
27 schema: 0
28 query: |2-
29
30 subscription ImportantEmails {
31 importantEmails
32 __typename
33 }
34
35 errors:
36 - message: Subscription "ImportantEmails" must select only one top level field.
37 locations:
38 - {line: 4, column: 9}
39- name: fails with many more than one root field
40 rule: SingleFieldSubscriptions
41 schema: 0
42 query: |2-
43
44 subscription ImportantEmails {
45 importantEmails
46 notImportantEmails
47 spamEmails
48 }
49
50 errors:
51 - message: Subscription "ImportantEmails" must select only one top level field.
52 locations:
53 - {line: 4, column: 9}
54 - {line: 5, column: 9}
55- name: fails with more than one root field in anonymous subscriptions
56 rule: SingleFieldSubscriptions
57 schema: 0
58 query: |2-
59
60 subscription {
61 importantEmails
62 notImportantEmails
63 }
64
65 errors:
66 - message: Anonymous Subscription must select only one top level field.
67 locations:
68 - {line: 4, column: 9}
View as plain text