Comments (9)
Can you try to run your tests in isolated process please (like phpunit)?
from graphqlbundle.
Thanks for your reply. I ran only the crashed test and here is the result:
Api Tests (3) -------------------------------------------------------------------------------------------------
Modules: Symfony2, Doctrine2, REST, \Helper\Api
---------------------------------------------------------------------------------------------------------------
Get all manufacturers (Loyalty\ProductBundle\Tests\GraphQL\GraphQLCest::getManufacturers)
Scenario:
* I send post "/auth/login",{"_username":"admin","_password":"admin"}
[Request headers] []
[Request] POST /auth/login {"_username":"admin","_password":"admin"}
[Response]
[Headers] {"cache-control":["no-cache"],"x-debug-token":["0d95df"],"Set-Cookie":[{},{}]}
[Status] 204
* I see response code is 204
* I send get "/",{"query":"query Manufacturers {
manufacturers {
id,
name
}
}"}
[Request headers] []
[Request] GET /?query=query+Manufacturers+%7B%0A++++manufacturers+%7B%0A++++++++id%2C%0A++++++++name%0A++++%7D%0A%7D
PHP Fatal error: Class 'Overblog\GraphQLBundle\__DEFINITIONS__\RangeFilterType' not found in /var/www/loyalty/product-bundle/var/cache/appTestDebugProjectContainer.php on line 3662
Fatal error: Class 'Overblog\GraphQLBundle\__DEFINITIONS__\RangeFilterType' not found in /var/www/loyalty/product-bundle/var/cache/appTestDebugProjectContainer.php on line 3662
RangeFilter seems the only one input-object
that crash. It is not used by the query, as i try to get manufacturers, but not products.
Here my full query definition:
Query:
type: object
config:
description: "Product bundle."
fields:
getProducts:
type: "QueryProduct"
args:
filter:
description: "Product search filters."
type: "ProductFilter"
page:
description: "Pagination number."
type: "Int"
limit:
description: "Pagination limit."
type: "Int"
resolve: "@=service('loyalty_product.product_manager').find(user, args['page'], args['limit'], args['filter'])"
manufacturers:
type: "[Manufacturer]"
resolve: "@=service('loyalty_product.manufacturer_manager').find()"
from graphqlbundle.
What's the content of your test cache dir please? it should look like that: my/path/to/cache/overblog/graph-bundle/__definitions__
from graphqlbundle.
The content of /var/cache/overblog/graph-bundle/__definitions__
:
__types.bootstrap.php.cache
ManufacturerType.php
PageInfoType.php
ProductFilterType.php
ProductHighLightFilterType.php
ProductLangFilterType.php
ProductOrderFieldFilterType.php
ProductOrderFilterType.php
ProductOrderTypeFilterType.php
ProductSearchFilterType.php
ProductType.php
QueryProductType.php
QueryType.php
RangeFilterType.php
And the source of RangeFilterType.php:
namespace Overblog\GraphQLBundle\__DEFINITIONS__;
use GraphQL\Type\Definition\InputObjectType;
use GraphQL\Type\Definition\Type;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
/**
* THIS FIELD WAS GENERATED AND SHOULD NOT BE MODIFIED!
*/
final class RangeFilterType extends InputObjectType
{
public function __construct(ContainerInterface $container)
{
$request = null;
$token = null;
$user = null;
if ($container->has('request_stack')) {
$request = $container->get('request_stack')->getCurrentRequest();
}
if ($container->has('security.token_storage')) {
$token = $container->get('security.token_storage')->getToken();
if ($token instanceof TokenInterface) {
$user = $token->getUser();
}
}
parent::__construct([
'name' => 'RangeFilter',
'description' => 'Range filter',
'fields' => [
'min' => [
'type' => function () use ($container, $request, $user, $token) { return Type::float(); },
'defaultValue' => null,
'description' => 'Min value.',
],
'max' => [
'type' => function () use ($container, $request, $user, $token) { return Type::float(); },
'defaultValue' => null,
'description' => 'Max value.',
],
],
]);
}
public static function getName()
{
$class = substr(strrchr(__CLASS__, "\\"), 1);
return substr($class, 0, -4);
}
}
from graphqlbundle.
And the content of __types.bootstrap.php.cache
? if it not empty try to require it before you test please
from graphqlbundle.
It seems that the file __types.bootstrap.php.cache
is not always generated. When i re initialize the app, sometimes, it is not there or empty.
from graphqlbundle.
I'm going to work on a fix! You can switch to the last release v0.3.0 this should fix the problem for the moment.
from graphqlbundle.
It works with 0.3 (because there is no cache, i presume).
(Just a notice: could you add a documentation on 'inline-object' too ? Thanks :)
from graphqlbundle.
Feel free to reopen if the fix doesn't solve your issue. I added the input-object
documentation.
from graphqlbundle.
Related Issues (20)
- Add support for `parseValue` configuration for `input-object` types
- Dynamic fields from database HOT 1
- Default enum value for argument when using annotations HOT 3
- MetadataParser will throw exception if you have Symfony PHP Configurations in your bundle HOT 4
- Types with same name differents according to schema
- Example from doc not working under Symfony 6 HOT 1
- The path "overblog_graphql_types.RootQuery._object_config.fields" should have at least 1 element(s) defined. HOT 10
- Ignoring of the name parameter of field attribute HOT 3
- Dataloader or Resolver Contexts & Parameters
- Type error introduced in 1.2.0 HOT 23
- Multiline documentation with a graphql schema leads to unnececairy indent/code block formatting HOT 1
- Multi level Input-object validation issue HOT 1
- Automatic type resolver for annotations/attributes
- ArgumentTransfomer should only validate arguments of type input
- Default field value for Input Object
- Annotations should be deprecated HOT 3
- Arguments order shouldn't matter
- Add ability to set HTTP status code and set own headers
- Help: Unclear how to use validation "link" with mutation/input objects HOT 2
- Validation is called on optional fields that are not passed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphqlbundle.