When using graphQl, it became necessary to create a query of the form:
movies(id:"RW50aXR5QWdncmVnYXRpb246VGhlIENvbWViYWNr") { name } I can’t search by id, which is assigned to graphQL elements, this is what works here:
{ node(id:"RW50aXR5QWdncmVnYXRpb246VGhlIENvbWViYWNr") { id ...on EntityAggregation { name } } } Is it possible to make graphql work by the first example?
schema:
movie: { type: new GraphQLList(EntityType), args: { id: { type: new GraphQLList(GraphQLInt) }, audience: { type: GraphQLString, // TODO: declare enum defaultValue: "OVER_18" } }, resolve: function (_, args, ctx) { return ctx.execute(search.searchEntities(args)) .then(result => result.entities); } } const EntityType = new GraphQLInterfaceType({ name: "Entity", interfaces: () => [nodeInterface], fields: () => ({ id: globalIdField(), type: { type: new GraphQLNonNull(EntityTypeEnum) }, name: { type: new GraphQLNonNull(GraphQLString) }, description: { type: new GraphQLNonNull(GraphQLString) }, }) }); export const searchEntities = R.curry(function( param: SearchParamType, ctx: UserContextType, token: string ): Promise<EntityResponseType> { const mappedParams = mapProperties(param, mapping, ctx); const uri = absoluteUri(config.asUri, searchUri); return httpClient.doGet(uri, mappedParams, token); });