Hyperledger composer How to include relationship in custom query

0 votes

I want to include relationships of particular asset in custom queries written in queries.qryfile:

Models

User
    o String id
    o String name
    o Integer age

Account
    id
    account_type
    --> User owner

queries.qry

query selectAccountByType {
  description: "Select all accounts based on type"
  statement:
    SELECT com.rohitkhatri.bank.Account WHERE (account_type==_$account_type)
}

Now, when I fetch the accounts, it should include the user relationship.

This is what I have tried, composer-rest-server:

/queries/selectAccountByType?account_type=saving&filter={"include":"resolve"}

It returns the following error:

{'status_code': 500, 'message': 'Invalid or extraneous parameter filter has been specified'}

Can someone help me out with this?

Nov 16, 2018 in Blockchain by digger
• 26,740 points
1,071 views

1 answer to this question.

0 votes

You are trying to use

filter={"include":"resolve"}

in Composer Query. But, it is a not part of the Composer Query Language syntax.

The Filter should be performed on the asset class in the REST APIs

answered Nov 16, 2018 by Omkar
• 69,230 points

Related Questions In Blockchain

0 votes
1 answer

How to solve EACCES:permission denied error in Hyperledger Composer?

It seems like there is no required ...READ MORE

answered Jul 11, 2018 in Blockchain by digger
• 26,740 points
2,360 views
0 votes
1 answer

How to solve "error trying install composer runtime" in Hyperledger composer?

I think the docker-compose tool is not ...READ MORE

answered Jul 17, 2018 in Blockchain by slayer
• 29,370 points
859 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,401 views
+1 vote
1 answer

I am unable to change port of composer-rest-server. Please help!

Use full format for running a business ...READ MORE

answered Mar 27, 2018 in Blockchain by Christine
• 15,790 points
1,090 views
+1 vote
1 answer
0 votes
1 answer

How to get TimeStamps in Hyperledger Composer?

Here's an example that works with basic-sample-network network: asset SampleAsset ...READ MORE

answered Oct 26, 2018 in Blockchain by Omkar
• 69,230 points
1,307 views
0 votes
1 answer

Hyperledger composer: How to allow create in transaction? Access Control

This is how you can do it: /** @returns ...READ MORE

answered Nov 8, 2018 in Blockchain by Omkar
• 69,230 points
901 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP