zino-hofmann / graphql-flutter

A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package.
https://zino-hofmann.github.io/graphql-flutter
MIT License
3.25k stars 620 forks source link

Error received: Null check operator used on a null value #1070

Closed scottyg2334 closed 2 years ago

scottyg2334 commented 2 years ago

When running "flutter pub run build_runner build" I'm receiving the following error:

`[INFO] Generating build script...ild [INFO] Generating build script completed, took 595ms

[INFO] Initializing inputs [INFO] Reading cached asset graph... [INFO] Reading cached asset graph completed, took 80ms

[INFO] Checking for updates since last build... [INFO] Checking for updates since last build completed, took 375ms

[INFO] Running build... [SEVERE] graphql_codegen:graphql_codegen on lib/GraphQL/getFriends.graphql:

Null check operator used on a null value [SEVERE] graphql_codegen:graphql_codegen on lib/GraphQL/schema.graphql:

Null check operator used on a null value [INFO] Running build completed, took 153ms

[INFO] Caching finalized dependency graph... [INFO] Caching finalized dependency graph completed, took 39ms

[SEVERE] Failed after 208ms pub finished with exit code 1 `

For Reference here is my Schema """ The@deferdirective may be provided for fragment spreads and inline fragments to inform the executor to delay the execution of the current fragment to indicate deprioritization of the current fragment. A query with@deferdirective will cause the request to potentially return multiple responses, where non-deferred data is delivered in the initial response and data deferred is delivered in a subsequent response.@includeand@skiptake precedence over@defer`. """ directive @defer( """ If this argument label has a value other than null, it will be passed on to the result of this defer directive. This label is intended to give client applications a way to identify to which fragment a deferred result belongs to. """ label: String

""" Deferred when true. """ if: Boolean ) on FRAGMENT_SPREAD | INLINE_FRAGMENT

""" The @stream directive may be provided for a field of List type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. @include and @skip take precedence over @stream. """ directive @stream( """ If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to. """ label: String

""" The initial elements that shall be send down to the consumer. """ initialCount: Int!

""" Streamed when true. """ if: Boolean! ) on FIELD

""" Delegates a resolver to a remote schema. """ directive @delegate( """ The path to the field on the remote schema. """ path: String

""" The name of the schema to which this field shall be delegated to. """ schema: Name! ) on FIELD_DEFINITION

directive @computed( """ Specifies the fields on which a computed field is dependent on. """ dependantOn: [Name!] ) on FIELD_DEFINITION

""" Annotates the original name of a type. """ directive @source( """ The original name of the annotated type. """ name: Name!

""" The name of the schema to which this type belongs to. """ schema: Name! ) repeatable on ENUM | OBJECT | INTERFACE | UNION | INPUT_OBJECT | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | ARGUMENT_DEFINITION | ENUM_VALUE

type Query { posts: [Post!]! postById(input: GetPostByIdInput!): GetPostByIdPayload! communities: [Community!]! communityById(input: GetCommunityByIdInput!): Community! users: [User] userById(input: GetUserByIdInput): GetUserByIdPayload relationsById(input: GetRelationsByIdInput): [Relationship] friends(input: GetFriendsInput): [Relationship] pendingFriendRequests(input: GetPendingFriendRequestsInput): [Relationship] declinedFriendRequests(input: GetDeclinedFriendRequestsInput): [Relationship] blockedFriendRequests(input: GetBlockedFriendRequestsInput): [Relationship] listOfJoinedCommunitiesFromSessions( input: GetListOfJoinedCommunitiesFromSessionsInput! ): [Uuid!]! messageById(input: GetMessageByIdInput!): [Message!]! messageByAuthor(input: GetMessageByAuthorInput!): [Message!]! messageByRecipient(input: GetMessageByRecipientInput!): [Message!]! messageByAuthorAndRecipient( input: GetMessageByAuthorAndRecipientInput! ): [Message!]! lobbiesByCommunity(input: GetLobbiesByCommunityInput!): [Lobby!]! }

type Mutation { addPost(input: AddPostInput!): AddPostPayload! deletePost(input: DeletePostInput!): DeletePostPayload! updatePost(input: UpdatePostInput!): UpdatePostPayload! addCommunity(input: AddCommunityInput!): AddCommunityPayload! removeCommunity(input: RemoveCommunityInput!): RemoveCommunityPayload! updateCommunityName( input: UpdateCommunityNameInput! ): UpdateCommunityNamePayload! addUserToCommunity( input: AddUserToCommunityInput! ): AddUserToCommunityPayload! inviteUserToCommunity( input: InviteUserToCommunityInput! ): InviteUserToCommunityPayload! removeUserFromCommunity( input: RemoveUserFromCommunityInput! ): RemoveUserFromCommunityPayload! banUserFromCommunity( input: BanUserFromCommunityInput! ): BanUserFromCommunityPayload! addUser(input: AddUserInput): AddUserPayload removeUser(input: RemoveUserInput): RemoveUserPayload createRelation(input: CreateRelationInput): CreateRelationPayload acceptRelation(input: AcceptRelationInput): AcceptRelationPayload declineRelation(input: AcceptRelationInput): AcceptRelationPayload blockRelation(input: BlockRelationInput): BlockRelationPayload addNewMessage(input: AddNewMessageInput!): AddNewMessagePayload! }

type AddPostPayload { post: Post! }

type DeletePostPayload { isDeleted: Boolean! }

type GetPostByIdPayload { post: [Post!]! }

type Post { id: Int body: String createdAt: DateTime postedFromUserID: Uuid countUpVoted: Int countDownVotes: Int countTotalEngagment: Int }

type UpdatePostPayload { post: Post! }

input AddPostInput { post: PostInput! user: UserInput! }

input DeletePostInput { post: PostInput! }

input GetPostByIdInput { id: Uuid! }

input PostInput { id: Int body: String createdAt: DateTime postedFromUserID: Uuid countUpVoted: Int countDownVotes: Int countTotalEngagment: Int }

input UpdatePostInput { post: PostInput! }

input UserInput { guid: Uuid! displayName: String firstName: String lastName: String email: String }

input communities_UserInput { id: Int! status: Int communityId: Int! guid: Uuid! displayName: String! firstName: String! lastName: String! email: String! }

type AddCommunityPayload { community: Community! }

type AddUserToCommunityPayload { user: User! }

type BanUserFromCommunityPayload { user: User! }

type Community { id: Int! guid: Uuid! communityName: String! dateCreated: DateTime! userCount: Int! users: [User!]! avatar: String! }

type InviteUserToCommunityPayload { user: User! }

type RemoveCommunityPayload { guid: Uuid! }

type RemoveUserFromCommunityPayload { user: User! }

type UpdateCommunityNamePayload { guid: Uuid! }

type User { id: Int! status: Int communityId: Int! guid: Uuid! displayName: String! firstName: String! lastName: String! email: String! }

type users_User { id: Int! guid: Uuid! displayName: String firstName: String lastName: String email: String }

input AddCommunityInput { guid: Uuid! name: String! userCount: Int avatar: String }

input AddUserToCommunityInput { user: communities_UserInput! community: Uuid! }

input BanUserFromCommunityInput { user: communities_UserInput! community: Uuid! }

input GetCommunityByIdInput { guid: Uuid! }

input InviteUserToCommunityInput { user: communities_UserInput! community: Uuid! }

input RemoveCommunityInput { guid: Uuid! }

input RemoveUserFromCommunityInput { user: communities_UserInput! community: Uuid! }

input UpdateCommunityNameInput { guid: Uuid! name: String! }

type AcceptRelationPayload { isAccepted: Boolean! }

type AddUserPayload { user: users_User }

type BlockRelationPayload { isBlocked: Boolean! }

type CreateRelationPayload { isCreated: Boolean! }

type GetUserByIdPayload { user: users_User }

type Relationship { id: Int! user1Id: Uuid! user2Id: Uuid! status: Int! lastActionUser: Uuid! }

type RemoveUserPayload { guid: Uuid! }

input AcceptRelationInput { user1Guid: Uuid! user2Guid: Uuid! }

input AddUserInput { guid: Uuid! displayName: String email: String firstName: String lastName: String }

input BlockRelationInput { user1Guid: Uuid! user2Guid: Uuid! }

input CreateRelationInput { user1Guid: Uuid! user2Guid: Uuid! status: Int! lastActionUser: Uuid! }

input GetBlockedFriendRequestsInput { guid: Uuid! }

input GetDeclinedFriendRequestsInput { guid: Uuid! }

input GetFriendsInput { guid: Uuid! }

input GetPendingFriendRequestsInput { guid: Uuid! }

input GetRelationsByIdInput { guid: Uuid! }

input GetUserByIdInput { guid: Uuid! }

input RemoveUserInput { guid: Uuid! }

type AddNewMessagePayload { message: Message! }

type Lobby { id: Int! lobbyGuid: Uuid! communityGuid: Uuid! name: String dateCreated: DateTime! maxConnectionsAllowed: Int! currentConnectionCount: Int! isPrivate: Boolean! avatar: String }

type Message { id: Int authorGuid: Uuid! recipientGuid: Uuid! msgBody: String! timeStamp: DateTime! read: Boolean sent: Boolean }

input AddNewMessageInput { authorGuid: Uuid! recipientGuid: Uuid! msgBody: String! timeStamp: DateTime! }

input GetListOfJoinedCommunitiesFromSessionsInput { guid: Uuid! }

input GetLobbiesByCommunityInput { communityGuid: Uuid! }

input GetMessageByAuthorAndRecipientInput { authorGuid: Uuid! recipientGuid: Uuid! }

input GetMessageByAuthorInput { guid: Uuid! }

input GetMessageByIdInput { id: Int! }

input GetMessageByRecipientInput { guid: Uuid! }

""" The name scalar represents a valid GraphQL name as specified in the spec and can be used to refer to fields or types. """ scalar Name

scalar Uuid

""" The DateTime scalar represents an ISO-8601 compliant date time type. """ scalar DateTime **Also here is my query used for testing** query { friends(input: {guid: "63f8720e-b193-4828-9174-a57bde0e5717"}) { user1Id user2Id lastActionUser } }`

scottyg2334 commented 2 years ago

Moved issue to: heft app/graphql_codegen https://github.com/heftapp/graphql_codegen/issues/51