Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(i): Remove default collection fields from gql view types #2202

Merged

Conversation

AndrewSisley
Copy link
Contributor

Relevant issue(s)

Resolves #2199

Description

Removes default collection fields from gql view types.

Views should not automatically have these fields. It will also be impossible to guarantee that they exist once we allow Views to have Lens transforms.

@AndrewSisley AndrewSisley added bug Something isn't working area/query Related to the query component labels Jan 12, 2024
@AndrewSisley AndrewSisley added this to the DefraDB v0.9 milestone Jan 12, 2024
@AndrewSisley AndrewSisley requested a review from a team January 12, 2024 17:13
@AndrewSisley AndrewSisley self-assigned this Jan 12, 2024
@nasdf
Copy link
Member

nasdf commented Jan 12, 2024

What happens if the user explicitly includes the _docID in the view query?

testUtils.CreateView{
  Query: `
	  Book {
                  _docID
		  name
	  }
  `,
  SDL: `
	  type BookView {
                   _docID: ID
		  name: String
	  }
  `,
}

@AndrewSisley
Copy link
Contributor Author

What happens if the user explicitly includes the _docID in the view query?

At the moment it will reject it (error on view creation), as _docID is a reserved field name. Users can work around that by aliasing - later we can perhaps allow them to declare it.

@AndrewSisley AndrewSisley merged commit bccf4e0 into sourcenetwork:develop Jan 12, 2024
27 of 29 checks passed
@AndrewSisley AndrewSisley deleted the 2199-rm-view-default-fields branch January 12, 2024 17:57
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Jan 22, 2024
…etwork#2202)

## Relevant issue(s)

Resolves sourcenetwork#2199

## Description

Removes default collection fields from gql view types.

Views should not automatically have these fields. It will also be
impossible to guarantee that they exist once we allow Views to have Lens
transforms.
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
…etwork#2202)

## Relevant issue(s)

Resolves sourcenetwork#2199

## Description

Removes default collection fields from gql view types.

Views should not automatically have these fields. It will also be
impossible to guarantee that they exist once we allow Views to have Lens
transforms.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/query Related to the query component bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Base level view GQL types include auto generated fields
2 participants