import { visitNodes } from "./SelectionSetParser" ; import { GraphQLResolveInfo } from "graphql" ; import { QueryObject } from './QueryObject' ; param info return { QueryObject } export const getQueryObject = ( info ) => { const fields = [ ] ; const relations = { } ; if ( info ) { const fieldNodes = info . fieldNodes ; if ( fieldNodes || fieldNodes . length !== 0 ) { visitNodes ( info , fieldNodes [ 0 ] . selectionSet , fields , relations ) ; } } return new QueryObject ( fields , relations ) ; } ;