►
Description
In this Backend pair programming session, we dive into writing a GraphQL field for accessing project forks which the user has write access to.
A
Right
thanks
for
hopping
on
back
end,
pairing
and
Lee's
got
something
that's
in
between
back
and
in
front
end.
So
I
guess
it
counts.
Yeah.
B
We're
gonna
figure
out
where
it
where
it
sits
so
I'm
going
to
try
and
share
and.
A
B
So
what
I,
don't
remember,
sorry
I'm
not
great
at
multitasking.
What
would
it
be?
Lee
ticket
gitlab,
slash,
gitlab
right
so
yeah,
so
it
looks
like
I
haven't,
got
a
personal
Fork
of
the
Get
Loud
project,
which
is
good
I.
Think
so,
if
I
try
and
launch
the
web,
ID
I
am
a
member
of
the
project.
So
that
is
no
good.
We'll.
A
Have
to
try
on
like
a
and
I
have
a
account.
No.
A
D
B
Right
so
let's
check
this
one
out.
So
has
this
one
got?
Oh
God,
I,
don't
even
know
what
my
username.
B
I
saw
I
I
can't
remember
who
to
give
credit
to,
but
I
saw
that
a
while
ago,
someone's
Alter
Ego
they
had
done
backwards
and
they
they
also
their
profile
picture,
was
them
upside
down
which,
which
really
made
me
laugh
so
I
I,
went
with
that
right.
Try
again.
If
I
launch
the
web
idea
there
you
go
so
it
says
I
can't
edit
files
in
the
in
the
in
the
project.
Do
you
want
a
full
kit?
B
So
it's
it's
assuming
that
if
you've
got
a
fork,
it's
in
your
own,
namespace
I
might
hit
fork
in
a
minute
and
just
see
what
then
happens
to
remind
us,
but
what
I
think
I
probably
have
got
access
to
is
if
we
change
this
to
get
their
community
and
launch
the
web
ID
here.
I
have
got
access
to
that.
So
my
initial
suggestion,
which
I'm
I'm
really
glad
we've
got
some
really
out
of
the
box
and
and
yeah.
B
Everyone
thinks
in
different
ways,
because
my
initial
thinking
was
that
we
have
a
new
set
in
at
project
level,
where
we
can
kind
of
set
almost
like
a
default
Fork
to
kind
of
say
you
know
we
want
everyone
to
use
this
Fork,
but
then
you
know
a
couple
of
people
bouncing
around
ideas.
They
kind
of
suggested.
Well.
B
What
if
we
just
presented
a
list
of
forks
that
you
have
access
to
so
when
we
click
on,
so
that's
on
the
fork
so
yeah
when
we
click
on
here,
if
you've
got
access
to
any
four,
then
I
mean
maybe
we
could
argue
if
you've
only
got
access
to
one
fork.
It
just
goes
straight
in
which
let
this
hit
for,
because
I
want
to
see
what
happens
but
yeah,
so
so
yeah.
What
does
does
that
immediately?
Does
it
scare
anyone?
Does
it
sound
like
the
the
common
sense
approach,
any
other
ideas,
I.
A
I
think
it's
a
really
good.
It's
a
it's
a
problem
we
haven't
solved
yet
of
access
to
Forks,
because
I
think
we're
probably
just
looking
for
because
of
being
a
little
familiar
with
with
these
back-end
methods.
Clearly
this
seems
to
be
looking
at
just
the
personal
namespace,
but
other
questions.
Sorry
other
places
we
look
for
it.
A
I
thought
we
would
check
it
if
you
forked
it
for
an
organization
but
like
you
have
to
own
it.
So
the
the
big
thing
I
think
is
unsolved.
Here
is
no
I,
don't
own
these
other
forks
I
just
have
access.
I
have
Push
access
to
the
other
Fork
and
that's
something
we're
not
checking
at
all,
which
would
be
very
interesting
too,
and
especially
from
like.
When
do
we
do
this
database
call?
A
Because,
right
now
we
optimistically
get
that
fork
path,
information
on
page
load
and
so
I,
don't
think
we're
gonna
want
to
open
up
any
kind
of
vector
we're
traversing
through
all
of
the
fork.
Someone
might
have
right
access
to
from
the
database
perspective,
so
I,
don't
know.
Yeah
I
mean
really
it's
a
problem.
B
Yeah,
it
is
it's
interesting
to
think
how
how
we
might
yeah,
what's
the
most
optimized
Steve
for
some
reason,
I
I
I
have
this
inkling
that
you're
a
database
with
or
maintainer
or
whatever.
So
maybe
a
good
point
for
you
to
to
kind
of
project
how?
How
might
be
the
most
optimistic
way
to
to
get
that
data
without
enumerating
obscene
amounts
of.
E
B
Although
saying
that
I
mean
even
the
gitlab
project,
how
many
Forks
are
there
like
a
thousand
ten
thousand?
B
It's
it's,
not
hundreds
of
thousands.
Is
it.
E
Man
I
think
the
the
right
approach
would
be
start
from
the
user
level
and
see
which
Forks
that
well
I,
don't
know
which
Forks
they
have
access
to
is
yeah,
like
you
said
the
owner
like
it's
easy
to
check,
which
ones
they
own,
but
then
there's
that
question
of
which
ones
do
they
have
access
to
that?
Maybe
they
don't
own
and
yeah
I'm,
not
totally
sure
how
Forks
are
like
set
up
in
terms
of
the
database
structure,
so
yeah.
B
But
it's
then,
when
it
comes
to
permissions,
remembering
how
our
permissions
you
know
you
can
either
have
permissions
at
the
project
level
or
the
group
level,
and
that
can
be
nested
groups
inherited
groups.
So
there's
all
sorts
of
those
complexities.
But
do
we
have
a
really
simple
I'm
sure
we
expose
a
simple
method
at
project
level,
but
if
we
were
to
call
that,
would
it
optimize
aquarium?
Would
it
enumerate
the
query
something.
E
F
E
B
D
If
we
can
at
least
Steve
I
mean
I'm,
sorry
Lee,
the
I
know
one
of
the
things
you
worked
on
recently,
I,
don't
like
so
I,
don't
know
exactly
what
you're
looking
for,
but
the
the
linear
namespace
queries
to
sort
of.
Do
the
the
right
and
left
Edge
thing
to
to
find
a
tree.
I,
don't
know
if
that's
applicable
to
this
problem,
but
are
you
aware
of
those.
B
I'm
I'm
vaguely
away
yes,
but
I,
don't
know
if
that
kind
of
really
ties
in
with
permissions.
If
that
makes
sense,
I
I
think
the
first
step
probably
would
be
to
see
what
method
we
think
exists
on
a
project
level
to
say:
has
this
user
got
right
access
to
the
project
and
if
we
combine
that
with
the
method
or
query
or
whatever
you
want
to
call
it
to
get
the
list
of
forks
for
a
canonical
project?
Does
that
generate
some
nice
SQL,
essentially
yeah
and.
G
B
Think
we
could
do
that.
Probably
just
from
the
Rouse
console
I
mean.
If
we
wanted
to
get
fancy,
we
could
write
a
spec
and
we
could
kind
of
use
that
as
a
starting
point.
But
I
think
we
could
probably
start
with
a
rouse
console
and
you
know
it'd
be
something
like
project.fine.4.
B
A
A
good
idea
can
I
ask:
can
we
can
we?
Can
we
get
back
to
that
from
the
user
facing
perspective?
I
have
a
couple
of
questions
for
you.
If
you
can
share
the
browser
tab
again,
yes,
I'd.
G
A
B
A
A
A
Right
and
so
from
this
perspective
we
really
want
to
know
the
ones
you
can
write
to
yep
and
there's.
No
that's
why
I
was
wondering
is
like.
Is
there
any
filtering
here
that
we
could
just
maybe
link
them
to
this,
and
then
that
would
be.
That
would
be
brilliant,
but
it
looks
like
there's
not
any
anything.
We
can
filter
here
to
get
just
the
ones.
D
B
Looks
like
it's,
your
slime
I
think
it
looks
like
Terry
shared
with
us.
A
method
whilst
I
can't
share
my
whole
screen.
I
can
I've
got
I
can
share
the
right.
C
There's
Scopes
in
the
project
that
might
but
I
also
don't
know
whether
those
are
great
Solutions
or
not,
because
it
looks
like
it
grabs
all
of
the
authorized
projects
for
a
user
just.
B
G
G
E
G
A
A
C
B
B
B
C
I
don't
know
if
that
is
that
a
class
method
or
no.
A
D
B
E
A
So
real
so
you're
saying
real:
can
we
can
we?
Can
we
test
this
out
by
like
removing
root
as
a
member
or
something
from
one
of
these.
B
Projects
because
Sarah
super
admin,
I
think
it'd
be
easier
for
me
to
find
you
just
find
a
user
and
give
them
access
to
one
of
the
four
can.
G
A
G
B
Just
it
from
the
UI
quickly,
I
might
even
just
give
it
up
like
give
a
user
access
to
one
of
the
one
of
the.
The
only
thing
is
the
forks
are
personal,
but
it
doesn't
I.
Don't
think
that
matters
well,
I
mean
to
be
honest.
If,
if
this
training,
these
two
commands
works
together,
that's
yeah.
E
B
A
F
A
G
B
I
have
added
a
user
Lee
ticket
to
I've,
given
them
access
to
a
fork
and
I'm
hoping
that
now,
if
we
use
user
53.
G
A
G
A
F
A
B
I
think
they
are
an
admin
groups
and
projects
yeah.
The
only
project
they've
got
access
to
is
the
Andrea.
A
B
Tell
me
what
you're
looking
for
well
Terry,
you
you
can
give
yourself
a
gold
star,
I!
Think.
B
So
that's
the
user
loud
right
right.
So
if
I
did
you
equals
user
dot
find
53
and
then
change
that
to
you.
That
should
already
be
much
nicer.
All
right!
We're.
A
B
E
B
G
B
Have
got
to
promote
so
you
know
I,
say:
we've
got
a
plan,
a
plan
a
bit
in
our
heads,
but
you
know
one
of
the
things
that
we'll
definitely
do
is
make
the
bot
anytime.
Anyone
raises
a
merge
request
that
isn't
from
the
community.
Fork
will
get
the
bot
to
prompt
them
and
sort
of
say
you
know,
did
you
know
about
the
community
fork
and
and
give
them
a
link
and
a
bit
of
info?
B
And
so
you
know
the
messaging
are
all
our
documentation.
Our
contribution
guides
Etc
all
slowly
get
updated
yeah.
Maybe
in
the
future
there
will
be
this
kind
of
concept
of
a
a
recommended
or
favorite
or
whatever
you
want
to
call
it.
So
somehow,
when
you
kind
of
click
the
fork
button,
it
actually
says
you
know.
Rather
than
do
you
want
to
create
your
own
Fork,
do
you
want
to
request
access
to
this
fork
or
something
like
that?
B
A
Like
I,
like
your
idea
of
the
I,
like
your
idea
of
the
bot,
that's
hey,
we
got
something
now
come
to
the
community
Fork.
Let's
like
that,
sounds
like
a
really
great.
A
Yeah
this
this
looks
great
yeah,
that's
kind
of
what
you're
describing.
A
A
This
might
have
changed,
but
you
had
to
be
a
member
of
their
GitHub
project
and
right.
So
they
have
a
so
what's
interesting.
Is
they've
somehow
created
a
process
around
a
GitHub
project
that
has
members
from
all
over
yeah
I
like
this
idea
of
this
community
Fork
that
you're
talking
about?
Because
it
reminds
me
a
lot
of
that
and
somehow
that
worked
for
unreal
and
so
people
making
contributions.
Somehow
this
is
this
is
working
for
them
and
I.
A
Think
that
sounds
like
a
huge
win
from
to
solve
a
lot
of
the
pains
that
that
I
think
community
members
experience
like
because
this
would
also
solve
their
CI
minutes
issues
too.
B
Yeah
I'll
I'll
bore
you
with
the
crime.
B
The
the
sort
of
really
nice
one
that
that
we
won't
sort
of
explore
too
much
until
a
bit
further
down
the
line,
but
is
the
collaborations
of
aspect
of
it
as
well,
and
we
really
want
to
start
getting
community
members
working
with
each
other
and
with
team
members
as
well,
and
it's
very
hard
to
do
that
at
the
moment
you
know
only
maintainers
of
the
gitlab
projects
can
push
commits
to
public
Community,
Forks
and
community
members.
Working
together
would
need
to
Grant
each
other
access
to
each
other's
personal
thoughts.
B
And
you
know
it's
yeah,
it's
all
a
bit
clunky,
but
these
are
our
kind
of
some
of
our
primary
wires.
We
started
this
in
the
first
place
and
yeah
the
the
the
kind
of
lots
of
I.
Don't
know
what
you
call
it
like,
not
walls
but
little
pain
points
that
would
hopefully
really
help
the
flow.
F
A
Be
to
see
if
we
can
get
a
if
we
can
get
a
graphql
endpoint
for
this,
then
this
is
all
just
front
end
from
there
yeah
can
we
maybe
open
up
the
graphql
Explorer
and
see
what's
kind
of
close,
and
maybe
we
can
spin
up
the
graphql?
A
B
So
we
kind
of
want
a
safe
project.
It
spouses,
like
Forks,
or
something,
although
saying
that,
if
I'm
totally
honest
I,
don't
I,
don't
know
how
close
we
even
need
to,
because
we
know
the
we've
we've
really
easily
come
up
with
the
the
Ruby.
Let's
say
the
Ruby
code
we
need
so
to
as
you
either
update
the
forks
method
or
create
a
new
method
that
kind
of
combines
the
forks
and
the
access
level
in
the
model
or
a
scope
or
whatever.
B
We
want
to
call
it
quite
straightforward
and
then
exposing
that
against
the
project,
projects,
type
I
would
say
is
probably
just
all.
We
really
want
to
do.
Yeah.
A
It's
really
I
think
it's
really
straightforward,
a
famous
last
words
right,
yeah,
I'm,
I'm,
I,
I've
quoted
those
words
a
lot
I'm
I'm
The,
Optimist
guy.
That's
like
oh
yeah!
We
get
this
done
in
a
week.
A
A
C
B
Great
question
I
think
that
that's
just
because
it
doesn't
make
sense,
though,
does
it
but
I,
don't
think
that's
our
implementation.
I
think
that's.
B
Yeah
graphql
rubies
sort
of
out
of
the
box,
it
it
it's,
but
essentially
it's
just
a
warning
to
tell
people
not
to
use
it
or
not
at
least
not
use
it
in
production,
because
we
could
break
it
at
any
point.
Okay,.
B
For
my
sins,
I
yeah
I
seem
to
to
live
in
graphql
at
the
moment
now,
I'm
happy
to
start
hacking
at
this
or,
like
you
know,.
A
Here's
this
this
looks
like
the
relevant.
You
ask
a
good
question.
I
think
I
found
the
relevant
code
for
you.
Terry
is
in
this
file.
Graphql
deprecations
I
can
open
it
since
we're
also
I.
C
Was
just
wondering
like
that's
weird:
why
does
it
stay
deprecated,
but
also
it's
an
alpha
like
those
two
things?
Don't
yeah.
D
All
right,
I,
just.
D
C
Yeah
I'm
playing
with
Garfield
the
only
other
thing
I'm
working
on
is
specs,
and
nobody
likes
saying
this,
but
me
so.
E
F
E
C
A
A
little
built
Lee
here,
let's
let's,
since
we
are
introducing
an
API,
let's
make
it
API
riffic
and
not,
and
it
doesn't
have
to
I,
don't
think
we
have
to
do
the
alpha
thing.
Let's,
instead
of
lee
I,
don't
think
we
have
to
make
this
an
alpha.
I,
don't
I,
don't
know
if
that's
part
of
our
process,
I'll.
B
Put
it
they
just
in
case
easily
removed,
but
it's
just
in
case
we
as
soon
as
we
don't
do
something
because
Alpha
then
I
can't
make
any
changes
to
it
without
waiting
for
18
releases.
So.
B
A
That's
fine
but
I
would
say:
let's
not
just
let's
call
this
writable
Forks,
let's,
let's
what's
the
word
of
thinking,
let's
let
it
be
a
little
bit
symmetric
with
the
function
with
the
method
that
we're
using
in
the
project
model.
So
whatever
that's
called
was
called.
G
A
B
G
A
B
B
I
suppose,
with
a
parameter
with
an
argument,
is
okay:
have
we
got
another
another
one
that
I
can
look
at?
That
takes
an
argument.
A
It's
like
I,
guess
so,
emotional
argument.
Yeah
we
could
have
an
optional
argument
with
some
sort
of
default
value.
It
sounds
good
too,
and
that's
probably
the
most
stable
of
the
interface,
but
let's
go
to.
A
B
B
Guessing
it
would
be
something
like
so
if
I
look
for
Star
type
Derby
and
look
for
argument.
Oh
here
we
go.
Oh
no!
That's
that's!
No!
That's
not
what
we
want.
A
If
you
go
to
the
query,
type
takes
Arguments
for
the
project,
so
that
would
be
query
type.
Has
a
field
for
project.
A
B
A
Yes?
Yes!
Yes!
Yes!
Yes!
Yes!
Yes,
here
you
go
all
right.
Here's
the
here's,
some
here's,
some
documentation
for
you,
so
it
looks
like
it'll,
be
called
like
argument.
A
A
Can
see,
there's
no
resolver,
so
if
you
search
the
type
for
the
method
container
repository,
that's
the
like
shortcut,
resolver
thing
so
search
if
you
yeah.
If
you
search
this
fold,
just
this
folder
another
folder
the
file,
just
this
file
for
container
repository,
you
see
this
file
has
a
method
container,
Repository,
gotcha.
B
A
C
B
B
F
B
But
yeah
I
think
so
I
think
so
now
I
always
get
confused
with
graphql
type.
So
is
it
types
in?
Is
it
that
simple
yeah?
It
looks
like
it.
A
G
B
A
I
need
to
I
need
to
cut
a
release
of
the
web
80
package,
so
they
can
show
up
and.
B
Awesome
right
visible
to
Minimax
this
level.
So
now
we
need
to
create
that
as
a
method.
A
A
F
B
A
I
meant:
do
we
need
to
scope,
set
the
default
value
here
or
do
we
need
to,
or
is
it
automatically
being
set
on,
The
Mod?
That
was
my
question.
F
E
You
shouldn't
need
to
be
because
stream,
those
two
together
but
still
gonna,
generate
one
query.
So,
unfortunately,.
B
Okay,
so
okay,
this
I
feel
like
we're
getting
crazy.
Now,
there's
there's,
you
know
when
you
think
see,
there's
no
way
it
was
gonna
work
already
I.
A
That's
gonna
be
great.
Now
we're
ready
to
do
the
graphql
Explorer
here,
yeah,
absolutely.
B
I've
seen
recently
Harry
did
you
even
I
think
you
might
have
commented
I
can't
remember
now
that
this
gets
really
really
angry.
If
there's
just
the
simplest
of
mistakes
in
your
graphql.
C
A
B
Really
confusing
that
right
so
that.
B
A
B
So,
let's
start
with
that
notes.
A
You're
missing
a
curly
race
after
full
path.
Thank.
A
G
B
It
does
try
project
type,
first,
I,
think
or
the
other
way
around.
Can
you
yeah
so
it
tries,
tries
this
as
well.
B
Me
just
check
you
know
what
I've
done.
I
know
that
should
work
shouldn't
it
it's
private,
but
that
should
still
work
I'm
going
to
get
rid
of
the
parameter
for
a
minute
just
to
see.
If
that
fixes,
it.
A
If
you
can
go
back
to
the
code,
that'll
be
helpful.
B
B
When
it
does
but
I
don't
think
it
should
have
to
be
a
public
method.
B
A
Think
I
think
what
might
be
happening.
B
A
The
rails
console
was
also
returning
empty.
Yes,
oh
interesting,
we
haven't,
we
leave
anything
around
while
we
were
playing
around
with
stuff.
B
E
See
now
that
the
visible
that
scope
is
using
user.authorized
projects
which
authorized
projects
might
be
direct
access.
E
B
Oh
wait
a
minute
I'm
even
more
confused,
oh
because
I'm
I'm
logged
in
as
right,
okay,
yeah
walking
in
progress
so
jh
all
right!
So
that's
done
so.
I
need
to
go
back
to
the
impersonation
again.
E
What's
it
called
tabs
that
are
oh.
B
A
member
of
so
we're
just
we're
a
member
of
the
group,
not
the
the
project
directly,
so
that
seems
to
have
worked
for
that,
but
I
I
wonder
if
it's
just
not
handling
the
admin
admin
administs
whatever
you
want
to
call
it
like.
B
It's
specifically,
like
you
say
it's
looking
for
membership,
it's
looking
at
the
group
and
project
level
level,
but
because
the
administrator
or
root
user
isn't
a
direct
that
well
sorry
they're,
not
a
direct
member
they're,
not
member
full,
stop.
The
only
reason
Roots
got
access
is
because
they're
an
admin.
B
B
A
A
The
it's
very
specifically,
things
need
to
have
named
arguments,
I
think.
B
So
you
know,
I
didn't
do
yeah
I
didn't
actually
try
passing
in
the
access
level
that.
B
C
C
I
think
that,
like
maybe
that's
a
nice
protective
picture
because
you
know
I,
think
there's
something
about
like
when
you
bring
back
personal
projects
or
the
admin
you
kind
of
there's
like
something
in
like
protective
in
there
to
make
make
sure
they're
not
getting
non-personal
projects.
I.
Don't
remember,
but
I
kind
of
remember
something
about
that.
G
B
I
tried
20.,
and
it
said
it
needs
to
be
an
access
level,
which
is
great
one
of
the
enums.
So
then
I
used
the
autocomplete
which
gave
me
that.
A
Saying
Maybe,
not
maybe
we
don't
get,
maybe
Min
axis
level
isn't
actually
integer
when
it's
getting
passed
through
them,
and
so
it's
trying
to
use
it.
This
is
active
record,
like
maybe
in
serialized.
A
B
B
Okay,
okay
right,
so
let
me
show
you
back
to
the
code:
I
changed
it
to
be
I
I
get
confused
between
that
I.
Had
that
I
changed
it.
B
It
so
I'm
now
going
to
go
back
to
try
changing
and
making
this.
Where
did
it
go
types?
G
B
Enum
enum
and
then
expect
to
explode,
or
maybe
not,
let's
have
a
look.
What
in
no
so
the
value
should.
A
G
D
A
B
A
B
Oh
yeah
I
mean
that
that'd
be
awesome.
Yeah,
I,
I
realize
we
have
the
fun
and
games
that
realistically
I'm
not
gonna
get
this
in
am
I.
Unless
I
ask
you
kind
folk
to
review
it
in
which
case,
because
if
we
can
get
it
in
for
15.9,
we
can
work
on
the
front
end
in
15.10.
B
But
if,
if
we
don't
get
it
in
before
Friday,
then
we
realistically
should
wait
until
15.11
to
work
on
the
front
or
to
merge
the
front
end.
Yeah.
B
That's
an
option,
but
you
know,
let's,
let's
pile
some
pressure
on
anyway.
I
really
appreciate
your
time
as
always
have
a
great
thanks.