File tree Expand file tree Collapse file tree 2 files changed +54
-0
lines changed
graphql-jpa-query-example-simple/src/main/resources
graphql-jpa-query-schema/src/test/java/com/introproventures/graphql/jpa/query/schema Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change 5
5
open-in-view : false
6
6
h2 :
7
7
console.enabled : true
8
+ datasource :
9
+ url : jdbc:h2:mem:starwars
8
10
9
11
graphql :
10
12
jpa :
Original file line number Diff line number Diff line change 38
38
import com .introproventures .graphql .jpa .query .schema .impl .GraphQLJpaSchemaBuilder ;
39
39
import com .introproventures .graphql .jpa .query .schema .model .starwars .Character ;
40
40
import com .introproventures .graphql .jpa .query .schema .model .starwars .Droid ;
41
+ import com .introproventures .graphql .jpa .query .schema .model .starwars .Human ;
41
42
42
43
@ SpringBootTest
43
44
@ Transactional
@@ -2118,4 +2119,55 @@ public void queryWithInLineExplicitOptionalFalseForSingularAttributeAndWhereSear
2118
2119
assertThat (result .toString ()).isEqualTo (expected );
2119
2120
}
2120
2121
2122
+ // https://github.com/introproventures/graphql-jpa-query/issues/273
2123
+ @ Test
2124
+ public void testGH273 () {
2125
+
2126
+ //given:
2127
+ String query = "{" +
2128
+ " Humans(where: {id: {EQ: \" 1000\" }}) {" +
2129
+ " select {" +
2130
+ " id" +
2131
+ " name" +
2132
+ " }" +
2133
+ " }" +
2134
+ " " +
2135
+ " Human(id: \" 1000\" ) {" +
2136
+ " id" +
2137
+ " name" +
2138
+ " }" +
2139
+ " " +
2140
+ "}" ;
2141
+
2142
+ String expected = "{"
2143
+ + "Humans={select=[{id=1000, name=Luke Skywalker}]}, "
2144
+ + "Human={id=1000, name=Luke Skywalker}"
2145
+ + "}" ;
2146
+
2147
+ //when:
2148
+ Object result = executor .execute (query ).getData ();
2149
+
2150
+ //then:
2151
+ assertThat (result .toString ()).isEqualTo (expected );
2152
+
2153
+ //and given
2154
+ Human human = em .find (Human .class , "1000" );
2155
+
2156
+ human .setName ("Luky Skywalker" );
2157
+
2158
+ em .flush ();
2159
+
2160
+ //when
2161
+ result = executor .execute (query ).getData ();
2162
+
2163
+ String updated = "{"
2164
+ + "Humans={select=[{id=1000, name=Luky Skywalker}]}, "
2165
+ + "Human={id=1000, name=Luky Skywalker}"
2166
+ + "}" ;
2167
+
2168
+ //then:
2169
+ assertThat (result .toString ()).isEqualTo (updated );
2170
+
2171
+ }
2172
+
2121
2173
}
You can’t perform that action at this time.
0 commit comments