Tag: tag
-
Graphql library helper to connect to external endpoint
0 For a project I have to do some requests in PHP to a GraphQL endpoint. I’m familiar with Graphql to build query’s. The most of the project is build in node.js, where I use axios to handle the requests. But in PHP I couldn’t figure it out, it seems I’m having problems setting up…
-
Installing vendor library using composer
0 I’m trying to use the https://github.com/webonyx/graphql-php/ library to make graphql requests.. But for some reason it doesn’t work, and I can’t figure out why. I’m using this command to install: composer require webonyx/graphql-php Vendor folder with content + composer.json / composer.lock appears in the project folder. When I try a simple code like: <?php…
-
Return custom collection in graphQL with Api Platform using custom data provider
0 I have a custom DTO class, and I want to return a collection of that using graphQL. With REST it works fine. I’m using Api Platform 2.6 and PHP 8.2 There is my DTO class : <?php declare(strict_types=1); namespace AppDto; use ApiPlatformCoreAnnotationApiProperty; use ApiPlatformCoreAnnotationApiResource; #[ApiResource( collectionOperations: [ ‘get’ => [ ‘method’ => ‘GET’, ‘path’…
-
“Extract” mutation name from an “OperationDefinitionNode” Object?
1 I am using the webonyx/graphql-php and Laravel. I have a single middleware that "catches" all graphql requests and I would like to apply some logic to filter some requests depending if the request is a mutation and which mutation it is. I "intersect" the graphql query (similar to this one) where the mutation storeCC…
-
Proceesing 2 queries graphql response that have same type into array
0 I have 2 queries that have same type I tried to insert findOrderByOid into [FindOrderByRestaurantId] like this var orderListData: ArrayList<FindOrderByRestaurantIdQuery.FindOrderByRestaurantId?> = ArrayList() fun getOrderList(){ scope.launch { apolloBuilder.apolloBuild().query( FindOrderByRestaurantIdQuery( id = "1" ) ).execute().apply { orderListData = data?.findOrderByRestaurantId?.toCollection(ArrayList()) ?: ArrayList() } } } fun getOrderDetail(){ scope.launch { apolloBuilder.apolloBuild().query( FindOrderByOidQuery( oid = "15" ) ).execute().apply {…
-
Proceesing 2 queries apollo graphql that have same type into 1 array
0 I have 2 queries that have same type I tried to insert findOrderByOid into [FindOrderByRestaurantId] like this var orderListData: ArrayList<FindOrderByRestaurantIdQuery.FindOrderByRestaurantId?> = ArrayList() fun getOrderList(){ scope.launch { apolloBuilder.apolloBuild().query( FindOrderByRestaurantIdQuery( id = "1" ) ).execute().apply { orderListData = data?.findOrderByRestaurantId?.toCollection(ArrayList()) ?: ArrayList() } } } fun getOrderDetail(){ scope.launch { apolloBuilder.apolloBuild().query( FindOrderByOidQuery( oid = "15" ) ).execute().apply {…
-
GraphQL iOS Apollo Client Automatic Persisted Queries Causing a Crash
1 Looking to get some help with setup of APQ’s on the iOS Apollo SDK, using version of Apollo 1.2.2 and when turned on the APQ as: let transport = RequestChainNetworkTransport(interceptorProvider: provider, endpointURL: url, autoPersistQueries: true) Getting an error on query fetch as: Apollo/RequestBodyCreator.swift:47: Fatal error: To enable autoPersistQueries, Apollo types must be generated with…
-
Take paired differences of pairs of rows
7 Create a new variable that is the difference of two adjacent rows of ‘price’ variable in the data set, where the new variable is the squared difference. test <- data.frame(id = c(6, 16, 26, 36, 46, 56), house = c(1, 5, 10, 23, 25, 27), price = c(79, 84, 36, 34, 21, 12)) where…
-
AWS Amplify: The variables input contains a field name that is not defined for input object type
6 I dont understad what happen here. This is my schema: type MonthResume @model @auth(rules: [{allow: owner, identityClaim: "sub"}]){ id: ID! incomes: Float! spendingByCategory: [Category] } type Category @model @auth(rules: [{allow: owner, identityClaim: "sub"}]){ id: ID! name: String! amount: Float! } This is the autogenerated update mutation that Amplify gives to me: export const updateMonthResume…
-
Totara GraphQL API Add New Query
0 I’m trying to add a new query to the Totara External GraphQL API available on Totara v17. Following the docs I’ve created the following structure: local/plugin/webapi/external/get_completions.graphql query local_plugin_get_completions{ local_plugin_get_completions{ id } } local/plugin/webapi/external/schema.graphqls extend type Query { local_plugin_get_completions: [local_plugin_get_completions!]! } type local_plugin_get_completions{ id: core_id, } local/plugin/classes/webapi/resolver/query class get_completions extends corewebapiquery_resolver { public static function…