1.0.0 • Published 3 years ago
@parameter1/google-ad-manager-graphql-generator v1.0.0
Google Ad Manager GraphQL Schema Generator
Reads the GAM API WSDL files and generates a corresponding GraphQL schema for a provided API version.
General
- WSDL types that lack child fields will be generated as a definition with a
_: Boolean
placeholder field. This is due to the GraphQL spec requring all definitions to have at least one field. This applies to all generatedType
,Interface
,Input
, andEnum
definitions. - When building fields for
Type
andInterface
definitions, the reference field value is handled as follows:- if explicitly mapped to a scalar value use the mapped value (e.g.
xsd:string
becomesString
) - otherwise, load the
WSDLType
object. - if
WSDLType.isEnumerated
, reference theEnum
name - if
WSDLType.abstract
, reference theInterface
name - if the type has child types (via extension), reference the
Interface
name - otherwise, use the
Type
name
- if explicitly mapped to a scalar value use the mapped value (e.g.
Enums
- A definition will be an
Enum
when theWSDLType.enumeration
array field has values.
Interfaces
- A definition will only be an
Interface
when theWSDLType.abstract
field is set totrue
. - A definition will be an
Interface
with a correspondingType
when the WSDL type is extended by another WSDL type.
Types
- A type will implement an
Interface
when theWSDLType.extension
field has a value set. - Types with the
WSDLType.abstract
field set totrue
will never be a concreteType
and will be generated as anInterface