You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// The map value is the go value the enum key is mapped to or the other way around
@@ -234,6 +233,41 @@ func main() {
234
233
}
235
234
```
236
235
236
+
### Interfaces
237
+
238
+
Graphql interfaces can be created using go interfaces
239
+
240
+
This library needs to anylize all types before you can make a query and as we cannot query all types that implmenet a interface you'll need to help the library with this by calling `Implements` for every implementation.
241
+
If `Implements` is not called for a type the response value for that type when inside a interface will always be `null`
242
+
243
+
```go
244
+
typeQuerySchemastruct {
245
+
BarBarWImpl
246
+
BazBazWImpl
247
+
BarOrBazInterfaceType
248
+
}
249
+
250
+
typeInterfaceTypeinterface {
251
+
// Interface fields
252
+
ResolveFoo() string
253
+
ResolveBar() string
254
+
}
255
+
256
+
typeBarWImplstruct{}
257
+
258
+
// Implements hints this library to register BarWImpl
259
+
// THIS MUST BE CALLED FOR EVERY TYPE THAT IMPLMENTS InterfaceType
0 commit comments