编写 以下 GraphQL schema
1.定义AppUsageRecord的类型
# Store usage for app subscriptions with usage pricing. type AppUsageRecord implements Node { # The date and time when the usage record was created. # createdAt: DateTime! # The description of the app usage record. description: String! # Globally unique identifier. id: ID! # The price of the usage record. The only permitted currency code is USD. #price: MoneyV2! # Defines the usage pricing plan the merchant is subscribed to. subscriptionLineItem: AppSubscriptionLineItem! }
2. 定义Node接口
# An object with an ID to support global identification. interface Node { # Globally unique identifier. id: ID! }
3.相应的Java AppUsageRecord实现
@Data //Store usage for app subscriptions with usage pricing. public class AppUsageRecord implements Node { //The date and time when the usage record was created. private OffsetDateTime createdAt; //The description of the app usage record. private String description; //Globally unique identifier. private String id; //The price of the usage record. The only permitted currency code is USD. //private MoneyV2 price; //Defines the usage pricing plan the merchant is subscribed to. private AppSubscriptionLineItem subscriptionLineItem; }
4.相应的Java Node实现
public interface Node { //Globally unique identifier. String getId(); void setId(String id); }
5. 如果直接运行,系统将会报错
Caused by: graphql.kickstart.tools.SchemaClassScannerError: Object type 'AppUsageRecord' implements a known interface, but no class could be found for that type name. Please pass a class for type 'AppUsageRecord' in the parser's dictionary.
6. 解决方案:
自定义配置AppUsageRecord在parser's dictionary.中
@Configuration public class GraphQLConfig { @Bean public SchemaParserDictionary dictionary() { SchemaParserDictionary dictionary = new SchemaParserDictionary(); dictionary.add(AppUsageRecord.class); return dictionary; } }
相关推荐
主要给大家介绍了java利用delayedQueue实现本地的延迟队列的相关资料,文中介绍的非常详细,相信对大家具有一定的参考价值,需要的朋友们下面来一起看看吧。
很好的Java面试题第二,Anonymous Inner Class (匿名内部类) 是否可以extends(继承)其它类,是否可以implements(实现)interface(接口)?
java学习-java中的interface和implements关键字
java中extends与implements的区别.docx
ImageComparerUI——基于Java语言实现的相似图像识别,基于直方图比较算法。 import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font...
使用java,swing 实现gps, 源码提供,简要如下: package gps; import java.awt.event.ActionListener; import javax.swing.*; import java.awt.event.*; import java.io.*; public class GpsFrame extends JFrame ...
This paper designs and implements a scheduling management system that uses Java language , JavaScript, MySQL database, and Java framework Spring technologies to complete in the eclipse compilation ...
Javaextends与implements的区别.docx
Java实现一个模型、两个视图和两个控制器的功能软件,即采用MVC模式或者说是观察者模式,本程序通过输入球体半径,显示球体形状,面积体积等 Sphere.java package Model; import java.util.Observable; public class...
* 基于秩实现的完全二叉树节点 */ package dsa; public class ComplBinTreeNode_Rank extends BinTreeNode implements BinTreePosition { private Vector T;//所属的树 private int rank;//在所属树中的秩 ...
public class BorrowBookList extends JFrame implements ActionListener { DataBaseManager db=new DataBaseManager(); ResultSet rs; Container c; JPanel panel1,panel2; JLabel BookNameLabel,...
* 基于列表实现(无序)词典结构 */ package dsa; public class Dictionary_DLNode implements Dictionary { private List L;//存放条目的列表 private EqualityTester T;//判等器 //构造方法 public ...
阿基米德螺旋线实验 简单java做的 ...public class ArchimedesJFrame extends JFrame implements ActionListener { private ArchimedesCanvas archimedes; private JRadioButton radiob_color[]; 。。。。。。。。
public class TreeLinkedList implements Tree { private Object element;//树根节点 private TreeLinkedList parent, firstChild, nextSibling;//父亲、长子及最大的弟弟 //(单节点树)构造方法 public ...
Alibaba Java Coding Guidelines pmd implements and IDE plugin.zip
Designed to solve many of the issues of working with REST, GraphQL comes alongside RelayJS, a React library for querying a server that implements the GraphQL specification. This book takes you ...
public class CleanMine extends JFrame implements ActionListener { private JLabel text1, text2; public static JLabel remainMine; private JLabel time; private JButton reset;// ���¿�ʼ ...
java中extends与implements的区别浅谈,需要的朋友可以参考一下
public class SetTest java
public class ComplBinTree_Vector extends BinTree_LinkedList implements ComplBinTree { private Vector T;//向量 //构造方法:默认的空树 public ComplBinTree_Vector() { T = new Vector_ExtArray(); root...