What is "buildQuery" parameter in "aor-graphql-client"

528 Views Asked by At

I am trying to work with "aor-graphql-client". When I try to create REST-client like in documentation, I get the error that "buildQueryFactory" is not a function. As I see, this function is using in here. From this object wee see that param "buildFactory" must be defined in options or in defaultOptions.

{
    client: clientOptions,
    introspection,
    resolveIntrospection,
    buildQuery: buildQueryFactory,
    override = {},
    ...otherOptions
} = merge({}, defaultOptions, options);

In defaultOptions this parameter isn't defined. In my options I now define only {client: {uri: ...}}, and I don't know what buildQuery means.

2

There are 2 best solutions below

0
On

The documentation you are referring to is from a deprecated package not related to aor-graphql-client (it was in fact our first try at GraphQL with Admin-on-rest).

The aor-graphql-client package only provides the basic "glue" to use GraphQL with Admin-on-rest.

The buildQuery option is explained here. In a nutshell, it is responsible for translating your GraphQL implementation to admin-on-rest.

We provided a sample implementation targeting the Graphcool backend: aor-graphql-client-graphcool. Use it as a starting point for implementing your own until we find some time to make the aor-graphql-client-simple (which will be a rewrite of the aor-simple-graphql-client you are referring to).

Have fun!

1
On

what is the buildfieldlist imported in builduery?