Closed danieledwardgeorgehitchcock closed 1 year ago
Hi,
I created a branch from this issue and pushed the fix.
I downloaded your project and tested your query, also I noticed another bug in the generation of a list of custom scalar type list_date[Date]
, that has been fixed too.
Soon I will publish a new version of the library with these fixes, in the meanwhile you could use the branch.
About the previous issue, since there were not bugs I will convert it in a discussion.
Thanks
Confirmed as working in 1.1.2 thanks!
Regarding the list_date issue, will I need to re-run the schema generation?
Is it also possible to make one of the fields in the output class as Optional?
I have tried importing the Optional typing and adding it to the field as follows, but it doesn't seem to work:
insightsChartData: Optional[DEFTF_InsightsChartDataOutput_Field]
Also, do you support fragments like this:
query GetMember {
member {
...MemberFragment
__typename
}
}
fragment MemberFragment on Member {
id
isBusiness
businessName
businessRegistrationNumber
registrationCompleted
fullyChargedPreregistered
investmentTotal
billSavingsAcrossAllProjects
expectedGenerationAnnualTotal
ownershipPercentageTotal
capacityOwnedTotal
hasReservedInActiveCoop
dateOfReservationInActiveCoop
dateOfLastSharePurchase
hasBoughtSharesInActiveCoop
hasBoughtSharesInGraigFatha
hasBoughtSharesInKirkHill
hasBoughtSharesInMultipleCoops
isSuppliedByOctopusEnergy
memberDocument {
id
file
documentUrl
__typename
}
address {
id
line1
line2
town
postcode
manuallyEntered
__typename
}
badges {
id
name
code
description
imageUrl
__typename
}
beneficiaries {
id
nominatedPerson
email
phone
line1
line2
town
postcode
__typename
}
invoices {
id
category
quote {
id
arrangementFee
billSavingsAnnualEstimate
capacity
costTotal
costTotalLocale
currency {
code
precision
symbol
__typename
}
ownershipMultiplier
paymentTotal
paymentTotalLocale
electricityConsumptionAnnual
__typename
}
__typename
}
memberships {
id
capacity
reservedCapacity
createdAt
expectedGenerationAnnualTotal
ownershipPercentage
investmentTotal
billSavingsForProjectLifespan
billSavingsFirstYearEstimateTotal
firstOwnershipPurchaseDate
coop {
...CoopFragment
__typename
}
lightShowImage
__typename
}
currentMemberSupplier {
id
accountIdentifier
supplier {
id
name
logoUrl
__typename
}
__typename
}
waitingListPlaces {
...WaitingListPlaceFragment
__typename
}
__typename
}
fragment CoopFragment on Coop {
id
name
code
wattageSku
status
active
description
maxGenerationPerMember
minGenerationPerMember
percentageFunded
publicCloseDate
estimatedBillSavingsPerWattHour
firstYearEstimatedBillSavingsPerWattHour
costTotalPerWattHour
isAvailableForLocalPurchase
localPurchasePostcodes
currency {
id
code
precision
symbol
__typename
}
generationfarm {
id
name
latitude
longitude
isLocationConfirmed
startDate
operationalStatus
generationType
capacity
capacityToGenerationFactor
lightShowImage
currency {
id
code
precision
symbol
__typename
}
__typename
}
documents {
documentUrl
version
document {
id
name
category
subcategory
description
updatedAt
documentTags {
id
name
__typename
}
__typename
}
__typename
}
__typename
}
fragment WaitingListPlaceFragment on MemberCoopWaitingListPlace {
id
generationRequestedKwh
waitingList {
...WaitingListFragment
__typename
}
__typename
}
fragment WaitingListFragment on CoopWaitingList {
id
coop {
id
name
__typename
}
__typename
}
Hi,
Regarding list[Date]
yes, you need to regenerate the code.
Note that I added also a feature for the dynamic visibility of fields, the usage of * symbol.
About optional I suppose it is for unions in graphql. Interfaces, unions and fragments were something I was planning to do, but due to the effort needed and other ideas that came up for other projects I left it behind. It would need some analysis, design review, etc to implement it but I am quite confident it can be done.
If you are strongly interested I would let you close this issue and open a discussion for those.
Thanks
As mentioned in #24 I am using this tool to create a python module (details in previous issue)
When I come to perform the
version
query which returns a string at the root, I get the following error when usingexport_gql_source
: