Comments (6)
I haven't worked with UnionTypes, but it should already work, since this package is built on top of the webonyx package that you linked. Have you tried creating a UnionType and adding it as a field?
from graphql-laravel.
Thank you for your response. I have tried the following:
https://gist.github.com/DiederikvandenB/1beee6e88d3671e72f2c639f17d10664
Attached to the gist is also the error message. What am I doing wrong?
I have also tried creating a SearchResultType
, adding it to the config and loading it as Type::listOf(GraphQL::type('SearchResult'));
but that throws an error saying that there is no toType
function available. Which makes sense because the UnionType is not extending your package.
Cheers!
from graphql-laravel.
Months later I am revisiting this issue. Any points you could give me?
from graphql-laravel.
@DiederikvandenB you can try my PR #91
I added basic support for Unions to the Rebing Type class. It does work despite the WIP flag.
from graphql-laravel.
Another hint @DiederikvandenB : I think you can't add raw webonyx types to the Facade/graphql config.
But you can indeed reference instances of your custom type in other types and queries or even define new types inline.
e.g:
'fields' => [
'fieldOther' => [ 'type' => GraphQL::type('SomeRebingType')],
'fieldUnion' => ['type' => new UnionType([ 'name' => 'MyUniqueUnionName', 'types' => [...]],
]
important: Do not forget the name when defining types inline.
from graphql-laravel.
@DiederikvandenB You can try the latest Version release 1.12.0, the PR has been merged.
There is also some documentation on https://github.com/rebing/graphql-laravel/blob/master/docs/advanced.md#unions
from graphql-laravel.
Related Issues (20)
- Tests are failing on CI HOT 3
- Cannot upgrade to laravel 10x because it cannot coexist with rebing dependency illuminate/contracts and illuminate/support
- Playground, are you thinking of implementing it?
- Unable to enable apq caching
- Is there documentation on returning objects with relation objects as a part of the type? HOT 4
- Pagination on Relation HOT 1
- Unexpected end of JSON input HOT 3
- queryContext in GraphQLController doesn't exist HOT 2
- L11: Unresolvable dependency resolving [Parameter #4 [ <required>; string $basePath ]] in class Illuminate\Foundation\Exceptions\Renderer\Renderer (500 Internal Server Error) HOT 1
- Improve error reporting when a type's name has illegal characters HOT 2
- GraphQL Request must include at least one of those two parameters: \"query\" or \"queryId\" HOT 3
- Add support for thecodingmachine/safe 2.0 HOT 2
- Nullable and Filled
- Resolver context is not updated once a user is logged in HOT 2
- repo description nit
- Pagination error HOT 2
- Integration tests for L9 are not working anymore
- useing $args in the resolve cloture of a type item
- Missing parent table in SelectFields for UnionType and InterfaceType HOT 3
- Using getRelations of SelectFields involves only selecting the requested fields for relationships HOT 5
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 graphql-laravel.