Add new query from Aimeos GraphQL

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
webmasterton
Posts: 2
Joined: 02 Jul 2024, 18:32

Add new query from Aimeos GraphQL

Post by webmasterton » 02 Jul 2024, 18:38

I created a new entity using the manager and I want to receive records from the new table in the order template of the administrative panel, similar to customer :

Code: Select all

<Multiselect class="item-customer form-control"
	value-prop="customer.id"
	track-by="customer.id"
	label="customer.code"
	@open="function(select) {return select.refreshOptions()}"
	@input="useCustomer($event)"
	:value="item"
	:options="async function(query) {return await customer(query)}"
	:disabled="!can('change')"
	:resolve-on-load="false"
	:filter-results="false"
	:can-deselect="false"
	:allow-absent="true"
	:searchable="true"
	:can-clear="false"
	:required="true"
	:min-chars="1"
	:object="true"
	:delay="300"
	>&nbsp;</Multiselect>

but I can’t figure out how to implement and add new methods for querying in graphQL such as useCustomer and customer

when requesting with my entity I get an error :
message
:
"Cannot query field \"searchSellers\" on type \"query\". Did you mean \"searchOrders\", \"searchReviews\", \"searchRules\", \"searchSuppliers\", or \"searchCustomers\"?"

User avatar
aimeos
Administrator
Posts: 8217
Joined: 01 Jan 1970, 00:00

Re: Add new query from Aimeos GraphQL

Post by aimeos » 04 Jul 2024, 08:13

To create GraphQL queries and and mutations for your new data domain automatically, add the domain name in ./config/admin.php of your own extension:

Code: Select all

return [
	'graphql' => [
		'domains' => [
			'mydomain' => 'mydomain'
		]
	]
];
See: https://github.com/aimeos/ai-admin-grap ... /admin.php
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

webmasterton
Posts: 2
Joined: 02 Jul 2024, 18:32

Re: Add new query from Aimeos GraphQL

Post by webmasterton » 12 Jul 2024, 09:25

Thx its work

Post Reply