![](/img/trans.png)
[英]GraphQL : Query failed to validate
我正在一個簡單的 java 程序中測試 graph-spqr 庫。 這是我到目前為止所做的: public class GraphQLResolver { private String status; private Integer price; @Gr ...
[英]GraphQL : Query failed to validate
我正在一個簡單的 java 程序中測試 graph-spqr 庫。 這是我到目前為止所做的: public class GraphQLResolver { private String status; private Integer price; @Gr ...
[英]How can I add properties to the mutation successful response
我是graphql-spqr 的新手,所以我希望這是一個簡單的問題,但是即使經過長時間的搜索,我也找不到解決方案。 提示:在我的應用程序中,我使用 code-first/schema-last 方法,我喜歡graphql-spqr ,所以沒有從文件加載 schema.graphqls 。 我的 ...
[英]GraphQL : How to write junit tests for graphql spqr and spring boot
我已經使用以下庫實現了 GraphQL 端點和 spring 引導 - https://github.com/leangen/graphql-spqr 。 我目前使用 WebTestClient 為 REST 端點提供 junit,並嘗試以類似的方式為 spqr 編寫 junit,但這不起作用。 ...
[英]GraphQL Federation: How To Consume, Not Extend
我有一個返回Product的服務,我可以通過 GraphQL Federation 在返回Review的服務中擴展它。 評論服務取決於Product ,這種解耦真是太棒了! 我還有一個訂單服務,它存儲(除其他外)具有productId的OrderItem : 現在我希望客戶也能夠直接 select ...
[英]graphiQL not showing GraphQL schmea (spring graphql-spqr)
我正在使用 spring-boot 和 graphql-spqr。 GraphQL 查詢和突變工作。 但是 GraphiQL webfrontend 沒有在最右邊一列的“文檔資源管理器”中顯示架構。 為什么? 我的 graphql Controller@RestController public ...
[英]GraphQL SPQR fetches all fields on the server side
我是 Spring Boot 的新手,我剛剛開始使用 graphql-spqr 進行 Spring Boot,因為它可以輕松引導 Java 項目。 但是,據我了解,GraphQL 基本上允許從數據庫中獲取選定的字段。 根據示例,我已經看到,graphql-spqr 庫中的這種選擇發生在客戶端。 有沒 ...
[英]GraphQL and Spring Security using @PreAuthorize?
我在設置 spring 安全性和禁用/啟用對graphql服務的 jwt 身份驗證的基於角色的用戶的訪問時遇到問題。 所有其他REST端點都受到適當保護,並且JWT身份驗證和基於角色的授權工作正常。 到目前為止我所擁有的: 在我的WebSecurityConfigurerAdapter class ...
[英]JWT Authentication graphql-spqr with spring security
我在 spring 啟動應用程序中使用 graphql-spqr-spring-boot-starter,版本 0.0.5。 @GraphQLApi 和 @GraphQLQuery 工作正常,我也在 /gui 上獲取數據。 但正如許多人所面臨的那樣,我正在嘗試在 graphql 服務器調用上應用身 ...
[英]Graphql Schema doku displays Input type automatically with Input
如自述文件中所述,我添加了leagen/graphql-spqr。 在我們自定義實現 graphql 類型之前,例如 customtype.types.gql。 實施后,一切正常,除了被稱為 OperatorInput 的類型,在自動生成的 graphql 文檔中命名,如“OperatorInpu ...
[英]graphql-spqr: How to add a GraphQL property to an entity
我有一個基本的 Java 實體 class。public class Result { String resultTitle; String resultDecription; } 此 class 在 GraphQL 查詢中返回@GraphQLQuery(name = "getResult ...
[英]graphql-java SPQR: how to use @GraphQLUnion annotation?
I inherited a project using GraphQL in Java with Grapqhl-SPQR spring boot starter package (v 0.0.3). 它使用注釋自動生成 GraphQL SDL,但我需要改進錯誤處理。 根據我在網上找到的,我需要 ...
[英]Get Original Field Name on GraphQL
我正在使用https://github.com/leangen/graphql-spqr和 spring-boot java 應用程序。 我可以很容易地找到別名,但如何才能找到原始字段名? 當我運行此代碼時,Output 看起來像別名字段:“aliasNameX”,...,但我需要像“origina ...
[英]Can I resolve fields that are not in the model with @GraphQLQuery
我們正在使用 graphql-spqr 從我們的 Java 后端 api 和模型生成 graphql 模式。 今天為了獲取產品,我們注釋了一個看起來像這樣的方法: 我們希望避免創建一個新端點來檢索 Product 中的額外字段。 有沒有辦法為不屬於模型的字段定義解析器? (注釋與否) 例 ...
[英]how to Disable Schema Introspection in graphql-spqr-spring-boot-starter
我已經將我的 spring boot 應用程序與graphql-spqr-spring-boot-starter https://github.com/leangen/graphql-spqr-spring-boot-starter集成,我需要找到一種關於如何禁用 graphql 模式自省的方法因為 ...
[英]How to implement query filters and sorting using Graphql SPQR?
如何使用 Graphql SPQR 實現查詢過濾和排序? 我正在尋找一個帶有 Graphql SPQR 的解決方案,用於看起來像這樣的架構。 ...
[英]How to get a schema file in graphql using spqr-spring-boot-starter?
誰能幫助我如何使用 spqr-spring-boot-starter 獲取模式文件? 我在網上找了解決方案,發現了這個: How to get the generated scheme file.graphqls using SPQR? 但我不確定我應該為模式傳遞什么? 當我使用 spqr-spr ...
[英]Unable to get rid of 'Exception while fetching data(/{apiName})' in graphql-spqr-spring-boot-starter
我正在使用 'io.leangen.graphql' 的 'graphql-spqr-spring-boot-starter' 庫版本 0.0.4。 我可以自定義錯誤。 請參閱以下代碼和屏幕截圖以供參考: 楷模: 服務 class: 自定義異常 class: 但是,我不確定如何Exception ...
[英]TypeMappingException: Multiple methods detected for operation “opName” with different return types
使用 graphql-spqr 和 Spring 引導,我正在嘗試運行該項目,但我遇到了這個: 我被重定向到這個尋求幫助: https://github.com/leangen/graphql-spqr/wiki/Errors#operation-with-multiple-resolver-met ...
[英]How can we get HttpServletRequest(DefaultGlobalContext) for GraphQL from RequestContextHolder for GraphQL (using graphql-spqr-spring-boot-starter)?
我正在使用graphql-spqr-spring-boot-starter庫將現有的 Rest API 項目遷移到 GraphQL。 我有一段代碼可以從RequestContextHolder中為 Rest API 獲取當前的HttpServletRequest : 但是,這將為 GraphQL ...
[英]Is there a way to read request headers in @GraphqQuery method
我需要在我的 graphql 查詢解析器中從請求 header 中讀取數據。 使用 graphql-spqr 庫。 方法樣本。 ...