antelopeql 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -85,33 +85,35 @@ export default function build_graphql_fields_from_abis(abi_list) {
85
85
  name
86
86
  );
87
87
 
88
- contract_query_fields[name] = {
89
- name,
90
- type: new GraphQLObjectType({
91
- name: name + "_query",
92
- fields: query_fields
93
- }),
94
- resolve(__, _, { network: { rpc_url, fetch } = {} }, { fieldName }) {
95
- if (!fetch)
96
- throw new GraphQLError(
97
- "No fetch argument found on the context of the GraphQL.execute."
98
- );
88
+ if (Object.keys(query_fields).length)
89
+ contract_query_fields[name] = {
90
+ name,
91
+ type: new GraphQLObjectType({
92
+ name: name + "_query",
93
+ fields: query_fields
94
+ }),
95
+ resolve(__, _, { network: { rpc_url, fetch } = {} }, { fieldName }) {
96
+ if (!fetch)
97
+ throw new GraphQLError(
98
+ "No fetch argument found on the context of the GraphQL.execute."
99
+ );
99
100
 
100
- if (!rpc_url)
101
- throw new GraphQLError(
102
- "No rpc_url argument found on the context of the GraphQL.execute."
103
- );
101
+ if (!rpc_url)
102
+ throw new GraphQLError(
103
+ "No rpc_url argument found on the context of the GraphQL.execute."
104
+ );
104
105
 
105
- return { code: fieldName.replace(/_/gmu, ".") };
106
- }
107
- };
106
+ return { code: fieldName.replace(/_/gmu, ".") };
107
+ }
108
+ };
108
109
 
109
- contract_mutation_fields[name] = {
110
- type: new GraphQLInputObjectType({
111
- name,
112
- fields: mutation_fields
113
- })
114
- };
110
+ if (Object.keys(mutation_fields).length)
111
+ contract_mutation_fields[name] = {
112
+ type: new GraphQLInputObjectType({
113
+ name,
114
+ fields: mutation_fields
115
+ })
116
+ };
115
117
  }
116
118
 
117
119
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antelopeql",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "A GraphQL implementation for interacting with Antelope based blockchains.",
5
5
  "repository": "github:pur3miish/antelopeql",
6
6
  "bugs": "https://github.com/pur3miish/antelopeql/issues",