4rthem / graphql-mapper-demo Goto Github PK
View Code? Open in Web Editor NEWA GraphQL Mapper demo
A GraphQL Mapper demo
Hey! Hoping you can help.
I'm trying to get the demo up and running.
I've made a few minor changes to make things happier with postgres, but effectively still the same. Doctrine works fine. I can seed the database.
But when I get to making a call...
$ php -S localhost:8000
PHP 5.6.30 Development Server started at Mon Jul 3 09:48:10 2017
Listening on http://localhost:8000
Document root is /Users/jmather/code/php/graphql-mapper-demo
Press Ctrl-C to quit.
curl -XPOST 'http://localhost:8000/entry.php' -d 'query=query FooBar {
luke: hero(episode: EMPIRE) {
id,
name,
friends {
id, name
}
},
droid(id: "2001") {
primaryFunction
}
}'
[Mon Jul 3 09:48:36 2017] ::1:56052 [200]: /entry.php - Call to a member function addImplementation() on string in /Users/jmather/code/php/graphql-mapper-demo/vendor/webonyx/graphql-php/src/Type/Definition/InterfaceType.php on line 54
Tracing this down further, that code is:
/**
* Queue the update of the interfaces to know about this implementation.
* This is an rare and unfortunate use of mutation in the type definition
* implementations, but avoids an expensive "getPossibleTypes"
* implementation for Interface types.
*
* @param ObjectType $impl
*/
public static function addImplementationToInterfaces(ObjectType $impl)
{
self::$_lazyLoadImplementations[] = function() use ($impl) {
/** @var self $interface */
foreach ($impl->getInterfaces() as $interface) {
$interface->addImplementation($impl); // here
}
};
}
So what IS $interface, if it's not the InterfaceType we expect but a STRING?!
or viewed another way...
It looks like somewhere there's a conversion not happening. Any ideas?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.