|
66 | 66 | end |
67 | 67 |
|
68 | 68 | specify { is_expected.to eq "graphql/cachedPost/schema_key-cachedPost(id:#{id})[id.title.author[id.name]]" } |
| 69 | + |
| 70 | + context "when excluding arguments" do |
| 71 | + let(:options) { {exclude_arguments: [:id]} } |
| 72 | + |
| 73 | + specify { is_expected.to eq "graphql/cachedPost/schema_key-cachedPost()[id.title.author[id.name]]" } |
| 74 | + end |
| 75 | + |
| 76 | + context "when including arguments" do |
| 77 | + let(:options) { {include_arguments: [:id]} } |
| 78 | + |
| 79 | + specify { is_expected.to eq "graphql/cachedPost/schema_key-cachedPost(id:#{id})[id.title.author[id.name]]" } |
| 80 | + end |
69 | 81 | end |
70 | 82 |
|
71 | 83 | context "when cached field has aliased selections" do |
|
109 | 121 |
|
110 | 122 | specify { is_expected.to eq "graphql/cachedPostByInput/schema_key-cachedPostByInput(input_with_id:{id:#{id},int_arg:42})[id.title.author[id.name]]" } |
111 | 123 |
|
112 | | - context "when argument is complext input" do |
| 124 | + context "when argument is complex input" do |
113 | 125 | let(:query) do |
114 | 126 | <<~GQL |
115 | 127 | query GetPostByComplexInput($complexPostInput: ComplexPostInput!) { |
|
130 | 142 | let(:variables) { {complexPostInput: {stringArg: "woo", inputWithId: {id: id, intArg: 42}}} } |
131 | 143 |
|
132 | 144 | specify { is_expected.to eq "graphql/cachedPostByComplexInput/schema_key-cachedPostByComplexInput(complex_post_input:{input_with_id:{id:#{id},int_arg:42},string_arg:woo})[id.title.author[id.name]]" } |
| 145 | + |
| 146 | + context "when excluding arguments" do |
| 147 | + let(:options) { {exclude_arguments: [:int_arg]} } |
| 148 | + |
| 149 | + specify { is_expected.to eq "graphql/cachedPostByComplexInput/schema_key-cachedPostByComplexInput(complex_post_input:{input_with_id:{id:#{id}},string_arg:woo})[id.title.author[id.name]]" } |
| 150 | + end |
| 151 | + |
| 152 | + context "when including arguments" do |
| 153 | + let(:options) { {include_arguments: [:complex_post_input, :input_with_id, :int_arg]} } |
| 154 | + |
| 155 | + specify { is_expected.to eq "graphql/cachedPostByComplexInput/schema_key-cachedPostByComplexInput(complex_post_input:{input_with_id:{int_arg:42}})[id.title.author[id.name]]" } |
| 156 | + end |
133 | 157 | end |
134 | 158 | end |
135 | 159 |
|
|
0 commit comments