Home Php C# Sql C C++ Javascript Python Java Go Android Git Linux Asp.net Django .net Node.js Ios Xcode Cocoa Iphone Mysql Tomcat Mongodb Bash Objective-c Scala Visual-studio Apache Elasticsearch Jar Eclipse Jquery Ruby-on-rails Ruby Rubygems Android-studio Spring Lua Sqlite Emacs Ubuntu Perl Docker Swift Amazon-web-services Svn Html Ajax Xml Java-ee Maven Intellij-idea Rvm Macos Unix Css Ipad Postgresql Css3 Json Windows-server Vue.js Typescript Oracle Hibernate Internet-explorer Github Tensorflow Laravel Symfony Redis Html5 Google-app-engine Nginx Firefox Sqlalchemy Lucene Erlang Flask Vim Solr Webview Facebook Zend-framework Virtualenv Nosql Ide Twitter Safari Flutter Bundle Phonegap Centos Sphinx Actionscript Tornado Register | Login | Edit Tags | New Questions | 繁体 | 简体

0
votes
answers
楼主
35 views
+10

如何將ServletRequest傳遞給在graphql-java中執行I/O的pojo

0

我需要根據請求將servlet屬性值傳遞給Query對象。我有這麼多的工作,但我怎樣才能從qt變量中獲得真正的查詢對象?如何將ServletRequest傳遞給在graphql-java中執行I/O的pojo

public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException { 
    GraphQLSchema schema = getSchemaProvider().getSchema(); 
    //schema.transform(c -> {}); 
    GraphQLObjectType t = schema.getQueryType(); 
    String rootLib = (String) req.getAttribute("ROOTLIB"); 
    super.service(req, res); 
} 
沙发
0
0

延伸DefaultQLSchemaProvider並重寫的getSchema(請求:HttpServletRequest的):GraphQLSchema方法。 然後重寫GraphQLEndpoint ctor並在調用super(GrapQLProvider,...)ctor時創建schemaProvider。

discard