Commit 4719c88f authored by Benoit Lavenier's avatar Benoit Lavenier

[fix] Fix node query

parent c20c51c7
Pipeline #7366 canceled with stages
......@@ -4,12 +4,23 @@ import {Server} from "duniter/server";
import {makeExecutableSchema} from "graphql-tools";
import {FullIindexEntry, FullMindexEntry} from "duniter/app/lib/indexer";
import {hashf} from "duniter/app/lib/common";
import {DBTx} from "duniter/app/lib/db/DBTx";
import {txAmount, txAmountForPubkey, txToMovement} from "./tx";
import {GraphQLObjectType, GraphQLType} from "graphql";
const pkg = require('../package.json')
const logger_1 = require("duniter/app/lib/logger");
export type IFieldContextPath ={
prev: IFieldContextPath|undefined;
key: string;
}
export type IFieldContext = {
fieldName: string;
path: IFieldContextPath;
parentType: GraphQLObjectType;
returnType: GraphQLType;
// TODO complete
}
export function plugModule(server: Server, logger?: any) {
logger = logger || logger_1.NewLogger();
......@@ -26,14 +37,16 @@ export function plugModule(server: Server, logger?: any) {
currency: () => server.conf.currency,
nodeSummary: () => {
logger && logger.debug("GVA: Processing query: nodeSummary")
// Conform to RFC
node: (_) => {
logger && logger.debug("GVA: Processing query: node", arguments);
const software = 'duniter';
const version = pkg.devDependencies[software].replace('^', '');
return {
duniter: {
summary: {
software,
version,
version: () => {
return pkg.devDependencies[software].replace('^', '');
},
forkWindowSize: server.conf.forksize
}
};
......
......@@ -256,14 +256,14 @@ type BlockchainParameters {
dtReeval: Int!
}
type NodeSummaryDuniter {
type NodeSummary {
version: String!
software: String!
forkWindowSize: Int!
}
type NodeSummary {
duniter: NodeSummaryDuniter
type Node {
summary: NodeSummary
}
type Mutation {
......@@ -274,8 +274,8 @@ type Mutation {
}
type Query {
hello: String
nodeSummary: NodeSummary!
hello: String!
node: Node!
blockchainParameters: BlockchainParameters!
currency: String!
block(number: Int): Block
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment