spring-graphql icon indicating copy to clipboard operation
spring-graphql copied to clipboard

Fixed schema and SecurityConfig samples/webmvc-http-security

Open kuraun opened this issue 3 years ago • 3 comments

  • Fixed the attribute value salary of UpdateSalaryInput of schema.graphqls to the name of SalaryInput object
  • Enable @Secured for Spring Security

kuraun avatar Apr 26 '22 05:04 kuraun

@kuraun Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

pivotal-cla avatar Apr 26 '22 05:04 pivotal-cla

@kuraun Thank you for signing the Contributor License Agreement!

pivotal-cla avatar Apr 26 '22 05:04 pivotal-cla

These changes make sense and are a step in the right direction, but we need additional changes to be able to test and for the tests to pass. For example, the sample is not currently enabled in main See 59b0d76d8d43c298cd05dc0bfecc64cc32d4b5f2

The changes are old enough that it was based off of 1.0.x but is pushing to main which I think at this point is causing some problems. When I get a bit further running the tests I get various NoSuchMethodErrors

canNotMutationUpdateSalary()
java.lang.NoSuchMethodError: 'void org.springframework.graphql.support.DefaultGraphQlRequest.<init>(java.lang.String, java.lang.String, java.util.Map)'
	at org.springframework.graphql.test.tester.DefaultGraphQlTester$DefaultRequest.request(DefaultGraphQlTester.java:162)
	at org.springframework.graphql.test.tester.DefaultGraphQlTester$DefaultRequest.execute(DefaultGraphQlTester.java:148)
	at io.spring.sample.graphql.WebMvcHttpSecuritySampleTests.canNotMutationUpdateSalary(WebMvcHttpSecuritySampleTests.java:84)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

rwinch avatar Jun 27 '22 22:06 rwinch

I've merged this into the 1.0.x branch where samples are still enabled. I also applied the same changes to the WebFlux sample, but the test fails and is disabled, if you want to give it a try @rwinch.

rstoyanchev avatar Nov 17 '22 12:11 rstoyanchev

@rstoyanchev Hi! Thank you for your thoughtfulness.

kuraun avatar Nov 18 '22 05:11 kuraun